<el-table-column :label="tabsDataFilters1.orgName" width="370" :fixed="tableFixed">
<el-table-column type="index" label="序号" width="50" align="center" :fixed="tableFixed"></el-table-column>
<el-table-column prop="name" label="姓名" width="200" align="left" :fixed="tableFixed"></el-table-column>
<el-table-column prop="age" :formatter="formatAmount" label="小计" width="120" align="center" :fixed="tableFixed"></el-table-column>
</el-table-column>
mounted进行监听,监听方法如下:
observeClassChanges() {
debugger
this.$nextTick(() => {
const bodyWrapper = this.$refs.table1.$el.querySelector('.el-table__body-wrapper');
if (!bodyWrapper) return;
// 创建 MutationObserver 监听 class 变化
this.observer = new MutationObserver((mutationsList) => {
for (const mutation of mutationsList) {
if (mutation.attributeName === 'class') {
this.removeScrollingClasses(bodyWrapper);
}
}
});
// 监听 `class` 变化
this.observer.observe(bodyWrapper, {
attributes: true,
attributeFilter: ['class'],
});
// 初始移除 class,防止渲染时已有
this.removeScrollingClasses(bodyWrapper);
});
},
// 滚动中间行样式移除
removeScrollingClasses(bodyWrapper) {
if (bodyWrapper.classList.contains('is-scrolling-middle')) {
bodyWrapper.classList.remove('is-scrolling-middle');
}
if (bodyWrapper.classList.contains('is-scrolling-left')) {
bodyWrapper.classList.remove('is-scrolling-left');
}
},
elment Table多级表头固定列后,合计行错位显示问题解决
晴空万里藏片云2025-02-24 1:37
相关推荐
软件聚导航21 小时前
「聚小软 AI 助手」技术升级:从数据库检索到 RAG 知识库问答恋猫de小郭21 小时前
看懂大模型架构术语,帮助你理解目前常见的大模型开源架构yma1621 小时前
通过提示词实现GitHub Pages 和 Nginx 双部署竟然这么简单?可乐鸡翅yeah_21 小时前
hls.js 内存泄漏实战排查,直播 M3U8 长时间播放异常定位方案前端 贾公子21 小时前
第09章:上下文与记忆 (2)可乐鸡翅yeah_21 小时前
第三方接口对接 M3U8 流媒体排坑实战,解决外部服务商流兼容难题GoppViper1 天前
RDF资源描述框架深度解析:语义Web的数据基石与实战逻辑郑州光合科技余经理1 天前
本地生活服务系统:模块边界与结算字段怎么拆IT_陈寒1 天前
Vue的嵌套组件竟然吃掉了我的事件?默_笙1 天前
🏠 「LLM Notes」:我用 Next.js + Redis 给自己造了个笔记博客