<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
相关推荐
Halo_tjn1 小时前
基于封装的专项 知识点摘星编程1 小时前
OpenHarmony环境下React Native:自定义useTruncate文本截断Duang007_2 小时前
【LeetCodeHot100 超详细Agent启发版本】字母异位词分组 (Group Anagrams)有来技术2 小时前
Spring Boot 4 + Vue3 企业级多租户 SaaS:从共享 Schema 架构到商业化套餐设计东东5163 小时前
学院个人信息管理系统 (springboot+vue)2601_949868363 小时前
Flutter for OpenHarmony 电子合同签署App实战 - 主入口实现m0_748229993 小时前
Vue2 vs Vue3:核心差异全解析C澒4 小时前
前端监控系统的最佳实践xiaoxue..4 小时前
React 手写实现的 KeepAlive 组件摘星编程4 小时前
在OpenHarmony上用React Native:自定义useHighlight关键词高亮