Skip to content

🔌 SortableJS/Vue.Draggable + ⚡ tangbc/vue-virtual-scroll-list = 💡✨

License

Notifications You must be signed in to change notification settings

ngti/vue-draggable-virtual-scroll-list

 
 

Repository files navigation

vue-draggable-virtual-scroll-list

https://github.com/p-baleine/vue-draggable-virtual-scroll-list/workflows/CI/badge.svg

Description

🔌 SortableJS/Vue.Draggable + ⚡ tangbc/vue-virtual-scroll-list = 💡✨

Vue component who put SortableJS/Vue.Draggable and tangbc/vue-virtual-scroll-list together and allow drag-and-drop and big amount data list with high scroll performance.

images/screenshot.gif

Usage

<div id="main">
  <draggable-virtual-list
    class="phrase-list"
    v-model="items"
    :size="50"
    :keeps="20"
    :data-key="'id'"
    :data-sources="items"
    :data-component="Item"
  >
  </draggable-virtual-list>
</div>

<script>
const Item = {
  props: {
    source: {
      type: Object,
      default () {
        return {}
      },
    },
  },
  template: `
    <div class="phrase" :key="source.id">
      {{ source.content }}
    </div>
  `
}

new Vue({
  el: '#main',
  components: {
    DraggableVirtualList,
  },
  data() {
    return {
      items: [
        { source: { id: 1, content: 'hello' } },
        { source: { id: 2, content: world' } },
        // ...
      ],
      Item
    }
  },
})
</script>

Please see ./example/index.html.

License

MIT License.

About

🔌 SortableJS/Vue.Draggable + ⚡ tangbc/vue-virtual-scroll-list = 💡✨

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 76.0%
  • HTML 17.7%
  • JavaScript 6.3%