Vue Draggable is a lightweight, dependency-free drag and drop library specifically designed for Vue.js applications. It leverages native HTML5 drag and drop APIs, making it a performant choice for reordering lists or moving items between zones. The current stable version is 2.0.6, and it primarily targets Vue 2.x environments. Its key differentiators include its complete lack of external dependencies, offering a lean footprint, and providing flexible integration options as a global plugin, a local directive, or an optional renderless component (`VueDraggableGroup`) for advanced reactivity management. While it does not specify a strict release cadence, updates are generally aligned with maintaining compatibility and addressing issues within the Vue 2 ecosystem.
npm install vue-draggableVerified import paths — ran on the pinned version, not inferred.
Demonstrates global plugin setup, basic usage of the `v-drag-and-drop` directive with options, and handling custom dropzone events in a Vue 2 application.
For Vue 3 projects, consider using alternative drag and drop libraries designed for Vue 3, such as 'Vue.Draggable' (based on Sortable.js) or 'vuedraggable-next'.
Add a unique `:data-id="item.id"` binding to each draggable element in your `v-for` loop.
If using VueDraggableGroup, ensure your project is running Vue 2.6.0+ or handle data model manipulation manually within the `onDrop` callback or custom events.
This library is not compatible with Vue 3. Migrate to a Vue 3 compatible drag and drop solution or downgrade your Vue version to 2.x.
Ensure `Vue.use(VueDraggable)` is called once at your application's entry point, or if registering locally, `import { VueDraggableDirective } from 'vue-draggable'` and include it in `directives: { dragAndDrop: VueDraggableDirective }` within your component options.For reactive data, consider using the `VueDraggableGroup` renderless component. If handling manually, ensure `reactivityEnabled: true` in your options and implement logic within `onDrop`, `@added`, `@removed`, or `@reordered` events to update your underlying data arrays.
No dependency data recorded yet.