问题
最近遇到一个问题,elementui设置固定列
通过拖拽列宽,固定列每行错位了
如图:
其实在此之前,我们知道普通的表格错位解决方法是
this.$refs.table.doLayout
对 Table 进行重新布局
解决方法
这里,需要知道是在哪个方法里执行
查看elementui文档,有一个事件header-dragend
<el-table ***省略其他参数*** ref="table" @header-dragend="headerDragend"></el-table>
headerDragend() {
this.$refs.table.doLayout()
}
这样就搞定了啦
来看看解决完成后的效果