1.网上使用最多的,个人测时没效果
// 全局设置
body .el-table th.gutter{
display: table-cell!important;
}
body .el-table colgroup.gutter{
display: table-cell!important;
}
2.使用el-table的doLayout方法(场景:el-table新加列后表头错位),在每次请求数据成功和mounted中加入
this.$nextTick(()=>{
this.$refs.table.doLayout()
})
3.在el-table组件挂载一个ref="table",然后在每次请求数据成功后动一动表格的默认宽度(99.99%不行可以继续往下调,0.01%调)
this.$refs.table.$el.style.width = '99.99%'
4.el-table-column使用了v-if