Vue Draggable

Vue component (Vue.js 2.0) or directive (Vue.js 1.0) allowing drag-and-drop and synchronization with view model array.

Based on and offering all features of Sortable.js

Description: Makes elements draggable and reorderable with Vue.js.

Installation:

npm install vuedraggable

Example Usage

<script setup>
import { ref } from 'vue'
import draggable from 'vuedraggable'

const items = ref(['Item 1', 'Item 2', 'Item 3'])
</script>

<template>
  <draggable v-model="items" tag="ul">
    <li v-for="item in items" :key="item">{{ item }}</li>
  </draggable>
</template>

Leave a comment

Your email address will not be published. Required fields are marked *