<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><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>export default {mounted () {this.$dragging.$on('dragged', ({ value }) => { console.log(value.item) console.log(value.list) console.log(value.otherData)})this.$dragging.$on('dragend', () => { })}}但是如果數(shù)據(jù)結(jié)構(gòu)是下面這種該如何排序?data:[ { name: '財(cái)務(wù)數(shù)據(jù)分析', children: [ { name: '工資', path: '/nav/dashboard/dash1' }, { name: '報(bào)銷', path: '/nav/dashboard/dash2' } ] },
vue-dragging --使用問題
富國(guó)滬深
2019-03-23 18:14:14