1. 需求
实现对模块的拖拽排序。
2. 安装依赖
npm install awe-dnd --save
3. 引入使用
3.1 main.js中全局引入
import VueDND from 'awe-dnd'
Vue.use(VueDND)
3.2 组件中引入及使用
<script>
export default {
data () {
return {
colors: [{
text: "Aquamarine"
}, {
text: "Hotpink"
}, {
text: "Gold"
}, {
text: "Crimson"
}, {
text: "Blueviolet"
}, {
text: "Lightblue"
}, {
text: "Cornflowerblue"
}, {
text: "Skyblue"
}, {
text: "Burlywood"
}]
}
},
/* if your need multi drag
mounted: function() {
this.colors.forEach((item) => {