<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
相关推荐
行走的陀螺仪27 分钟前
vue3-封装权限按钮组件和自定义指令isyuah36 分钟前
vite-plugin-openapi-ts CLI 使用指南qq_398586541 小时前
浏览器中内嵌一个浏览器abiao19811 小时前
如何在 VSCode 中创建 Vue 项目Mapmost1 小时前
地图引擎性能优化:解决3DTiles加载痛点的六大核心策略San30.2 小时前
Ajax 数据请求:从 XMLHttpRequest 到现代前端数据交互的演进西西西西胡萝卜鸡2 小时前
虚拟列表(Virtual List)组件实现与优化铁臂猿版(简易版)宇余2 小时前
Unibest:新一代uni-app工程化最佳实践指南*小雪2 小时前
uniapp写H5授权登录及分享,返回到目标页面性野喜悲2 小时前
ts+uniapp小程序时间日期选择框(分开选择)