发现当组件有父组件后就不能拖拽了
如何解决
首先el-table一定要加row-key 若依旧不能拖动 给el-table加上类名
<el-table
class="airlineDeviceTable"
resizable
highlight-current-row
row-key="id"
在拖动函数上加上el-table的类名
rowDrop(){
const tbody = document.querySelector('.airlineDeviceTable .el-table__body-wrapper tbody');
const that = this;
Sortable.create(tbody, {
draggable:".el-table__row",
// 结束拖拽后的回调函数
onEnd({ newIndex, oldIndex }) {
console.log('拖动了行,当前序号:' + newIndex);
const currentRow = that.tableData.splice(oldIndex, 1)[0];
that.tableData.splice(newIndex, 0, currentRow);
},
})
},