<template v-for="(item,index) in info.data" :key="index" >
<div class="sub-set" draggable="true" @dragstart="dragstart($event,index)" @dragover="dragover" @drop="drop($event,index)" >
dragstart(event: any, index: number) { this.startIndex = index; }, dragover(event: any,) { event.preventDefault(); }, drop(event: any, index: number) { const moveData = this.info.data.splice(this.startIndex, 1) as any; this.info.data.splice(index, 0, moveData[0]); },
标签:原生,index,moveData,any,number,拖拽,startIndex,event From: https://www.cnblogs.com/lopb/p/18384721