Vue3 Element plus table有fixed列时错行
table 有fixed列,并且有其他列需要动态展示时,出现错行现象。尝试两种解决方案。
1.官方的doLayout()方法(不起效果)
import { getCurrentInstance } from "vue";
const instance = getCurrentInstance()!;
instance?.proxy?.$refs["el-table"].doLayout();
2.结合使用列的width(解决)
fixed类添加固定列宽,与操作列相邻的一列添加minWidth
{label: "Status",prop: "Status",minWidth: 160},{label: "Operations",fixed: "right",width: 120,slot: "operation"}