Vue3 Element plus table有fixed列时错行

table 有fixed列,并且有其他列需要动态展示时,出现错行现象。尝试两种解决方案。

1.官方的doLayout()方法(不起效果)

javascript 复制代码
import { getCurrentInstance } from "vue";
const instance = getCurrentInstance()!;
instance?.proxy?.$refs["el-table"].doLayout();

2.结合使用列的width(解决)

fixed类添加固定列宽,与操作列相邻的一列添加minWidth

javascript 复制代码
  {
      label: "Status",
      prop: "Status",
      minWidth: 160
 },
    {
      label: "Operations",
      fixed: "right",
      width: 120,
      slot: "operation"
    }
相关推荐
阿蒙Amon11 小时前
TypeScript学习-第7章:泛型(Generic)
javascript·学习·typescript
睡美人的小仙女12711 小时前
Threejs加载环境贴图报错Bad File Format: bad initial token
开发语言·javascript·redis
fanruitian12 小时前
uniapp android开发 测试板本与发行版本
前端·javascript·uni-app
摘星编程12 小时前
React Native + OpenHarmony:Timeline垂直时间轴
javascript·react native·react.js
2501_9445255413 小时前
Flutter for OpenHarmony 个人理财管理App实战 - 支出分析页面
android·开发语言·前端·javascript·flutter
jin12332214 小时前
React Native鸿蒙跨平台完成剧本杀组队详情页面,可以复用桌游、团建、赛事等各类组队详情页开发
javascript·react native·react.js·ecmascript·harmonyos
经年未远15 小时前
vue3中实现耳机和扬声器切换方案
javascript·学习·vue
刘一说15 小时前
Vue 组件不必要的重新渲染问题解析:为什么子组件总在“无故”刷新?
前端·javascript·vue.js
可触的未来,发芽的智生15 小时前
狂想:为AGI代称造字ta,《第三类智慧存在,神的赐名》
javascript·人工智能·python·神经网络·程序人生
徐同保16 小时前
React useRef 完全指南:在异步回调中访问最新的 props/state引言
前端·javascript·react.js