Addon to support draggabilly for Vue.js Packery Plugin
Vue.js Packery Plugin must be present in project
npm install --save vue-packery-draggabilly-plugin
then
import VueDraggabillyPlugin from 'vue-packery-draggabilly-plugin'
Vue.use(VueDraggabillyPlugin)
<div v-draggabilly v-packery='{itemSelector: ".packery-item", percentPosition: true}'>
<div v-draggabilly v-packery-item class='packery-item'></div>
<div v-draggabilly v-packery-item class='packery-item'></div>
<div v-draggabilly v-packery-item class='packery-item'></div>
</div>
Pass an object with Draggabilly options as an argument to the v-draggabilly directive to change the settings.
Passing along the custom key disableDraggabilly
with a bool, disables/enables (true/false) the draggabilly instace via the official draggie.disable()
& draggie.enable()
methods.
Or the custom key recalculateOnMove
which updates card position upon drag, good for CSS transformed views.
Example usage:
<div v-draggabilly="{
axis: 'x',
grid: [ 20, 20 ],
handle: '.handle',
containment: true,
disableDraggabilly: false
}" v-packery-item class='packery-item'></div>