vue项目element ui与sortablejs实现表格列的拖拉拽,并且实现列的动态隐藏显示,功能已经实现了,就是有个bug,拖动列的时候,表头没有重新渲染,每列的数据是变了的,麻烦远程看看有偿
不知道你这个问题是否已经解决, 如果还没有解决的话:对于这个问题,可以按照以下步骤进行解决:
import Sortable from "sortablejs";
<el-table-column label="排序" :sortable="true" prop="sort">
<template #default="scope">
<div class="address_list">
<el-input-number
v-model="scope.row.sort"
:min="1"
:max="10"
@change="handleCountChange(scope.row)" />
</div>
</template>
</el-table-column>
_this.rootDepart.sortableObj = Sortable.create(el);
// 销毁排序
_this.rootDepart.sortableObj.destroy();
<el-table-column
:visible="showColumn"
label="列名"
prop="property"
></el-table-column>
其中,showColumn是用来控制列的显示/隐藏的变量。