移入模块
package.json中引入
"vuedraggable": "^2.20.0",
import draggable from 'vuedraggable'
<draggable v-model="myapply" @update="datadragEnd"><transition-group class="group clearfix navul"><div v-for="(nav,i) in myapply" :key="nav.id" class="dragli">{
{nav.menuAlias}}<i @click="removeApply(nav,i)" v-if='defaultapply.indexOf(nav.menuName)==-1'>-</i></div></transition-group>
</draggable>
//更新组件
datadragEnd (evt) {console.log('拖动前的索引 :' + evt.oldIndex)console.log('拖动后的索引 :' + evt.newIndex)
},