import { createApp } from 'vue'
import mitt from 'mitt'
import { VueMasonryPlugin } from "vue-masonry/src/masonry-vue3.plugin";
const emitter = mitt()
let app = createApp(App)
app.config.globalProperties.emitter = emitter
app.use(VueMasonryPlugin)
app.mount('#app')
<div v-masonry="containerId" transition-duration="0.3s" item-selector=".item">
<div v-masonry-tile class="item" v-for="(item, index) in blocks">
<!-- block item markup -->
</div>
</div>
Usage
Vue 3
Vue 2
import Vue from 'vue'
// import ES6 style
import {VueMasonryPlugin} from 'vue-masonry';
// or using CJS
// const VueMasonryPlugin = require('vue-masonry').VueMasonryPlugin
Vue.use(VueMasonryPlugin)
<div v-masonry="containerId" transition-duration="0.3s" item-selector=".item">
<div v-masonry-tile class="item" v-for="(item, index) in blocks">
<!-- block item markup -->
</div>
</div>
Comments
Related