1.安装:npm i vuedraggable
2.引用:1.import draggable from “vuedraggable”;
2.export default {
components: {
draggable,
},
}
3.典型用途:
<draggable v-model = “ myArray ” group = “ people ” @开始= “ drag = true ” @ end = “ drag = false ” >
< div v-for = “ myArray” :key = “ element.id ” > {{element.name}} </ div >
在项目中引用: ‘
需要修改一点样式: