拖动排序
vuedraggable
安装
npm i vuedraggable -S
使用
<template>
<draggable
v-model="myArray"
group="people"
@start="drag = true"
@end="drag = false"
>
<div v-for="element in myArray" :key="element.id">{{ element.name }}</div>
</draggable>
</template>
<script>
import draggable from "vuedraggable";
</script>
sortablejs
安装
npm install sortablejs --save
使用
import Sortable from "sortablejs";
var el = document.getElementById("items");
var sortable = Sortable.create(el);