This `vue-draggable-virtual-scroll-list` package is a Vue 2 component designed to combine the drag-and-drop capabilities of `SortableJS/Vue.Draggable` with the performance benefits of `tangbc/vue-virtual-scroll-list` for rendering large datasets. It allows developers to create sortable lists that efficiently handle a significant number of items by only rendering the visible elements, while still supporting intuitive drag-and-drop interactions. Currently at version 0.0.15, the project appears to be in an early development phase, suggesting potential for rapid changes. Its primary differentiation lies in offering a pre-integrated solution for two common UI challenges in Vue 2: managing large lists and enabling sortability, bypassing the need for manual integration of these complex libraries. It explicitly lists Vue 2.6.14 or higher as a peer dependency, firmly placing it within the Vue 2 ecosystem.
npm install vue-draggable-virtual-scroll-listVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to set up `DraggableVirtualList` in a Vue 2 application, providing a sortable, virtualized list of 1000 items. It shows how to pass data, configure item height, and specify the individual item component.
Always review the GitHub repository's commit history or examples for specific changes when updating to a new version.
For Vue 3 projects, seek out alternative libraries like `vue-virtual-sortable` or the Vue 3 compatible versions of `vuedraggable` and `vue-virtual-scroll-list`.
Ensure each item in your `items` array has a unique property (e.g., `id`) and set `:data-key="'id'"`.
Always bind both `v-model` and `:data-sources` to the same array reference, e.g., `v-model="items" :data-sources="items"`.
Experiment with `:size` to accurately match your item's actual height in pixels and adjust `:keeps` to find a balance between smooth scrolling and memory usage.
Ensure you have `import { DraggableVirtualList } from 'vue-draggable-virtual-scroll-list'` and added it to your Vue instance's `components` option: `components: { DraggableVirtualList }`.Verify that each item in your `v-model` array has a unique `id` property and that `:data-key` is correctly set to this property (e.g., `:data-key="'id'"`). Ensure your `data-component` structure is stable and not causing unexpected re-renders or DOM manipulation.
Check that your `v-model` is correctly bound to your data array, `:data-key` points to a unique identifier, and your `data-component` correctly exposes the `source` prop for individual items to facilitate reordering.