Vue---拖拽
好用的拖拽组件:Awe-dnd
npm install awe-dnd --save
集成:main.js
import VueDND from 'awe-dnd' Vue.use(VueDND)
使用:
<!--your.vue--> <script> export default { data () { return { colors: [{ text: "Aquamarine" }, { text: "Hotpink" }, { text: "Gold" }, { text: "Crimson" }, { text: "Blueviolet" }, { text: "Lightblue" }, { text: "Cornflowerblue" }, { text: "Skyblue" }, { text: "Burlywood" }] } } } </script> <template> <div class="color-list"> <div class="color-item" v-for="color in colors" v-dragging="{ item: color, list: colors, group: 'color' }" :key="color.text" >{{color.text}}</div> </div> </template>
参考:
https://blog.csdn.net/gitblog_00027/article/details/141041469
打完收工!

浙公网安备 33010602011771号