<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
相关推荐
苏打水com1 天前
第九篇:Day25-27 Vue进阶——组件复用与状态管理(对标职场“复杂项目”需求)老华带你飞1 天前
博物馆展览门户|基于Java博物馆展览门户系统(源码+数据库+文档)PineappleCoder1 天前
别让页面 “鬼畜跳”!Google 钦点的 3 个性能指标,治好了我 80% 的用户投诉卤代烃1 天前
🕹️ [AI] Chrome DevTools MCP 原理分析梦里不知身是客111 天前
flink对于迟到数据的处理卤代烃1 天前
🤝 了解 CDP (Chrome DevTools Protocol):browser-use 背后的隐藏功臣一 乐1 天前
人事管理系统|基于Springboot+vue的企业人力资源管理系统设计与实现(源码+数据库+文档)b***74881 天前
前端状态系统的时代变革:从本地状态到全局状态,再到智能状态的未来趋势秋氘渔1 天前
Vue 3 组合式API中的生命周期钩子函数介绍拉不动的猪1 天前
requestAnimationFrame 与 JS 事件循环:宏任务执行顺序分析