// =======拖拽 插件
cnpm install vuedraggable
import draggable from ‘vuedraggable‘
{{element.id}}
data() {
return {
msg: ‘Welcome to Your Vue.js App‘,
tags: [{
id: 1
}, {
id: 2
}]
}
},
methods: {
getdata(evt) {
console.log(evt.draggedContext.element.id)
},
datadragEnd(evt) {
console.log(‘拖动前的索引 :‘ + evt.oldIndex)
console.log(‘拖动后的索引 :‘ + evt.newIndex)
console.log(this.tags)
}
},