效果图,如上图
这里是初始化表格数据的
beforeDestroy () { this.tableBodyWrapper.removeEventListener('scroll', this.setScrollTop); }, this.$nextTick(() => { setTimeout(() => { this.tableBodyWrapper = this.$refs['elTable'].bodyWrapper; this.tableBodyWrapper.addEventListener('scroll', this.setScrollTop); }); }); setScrollTop() { let scrollTop = this.tableBodyWrapper.scrollTop;// 滚动高度 this.$refs['elTable'].$refs.fixedBodyWrapper.scrollTop = scrollTop; },
导致问题的原因是,固定列的表格进行了计算。
标签:滚动,错行,表格,elementui,tableBodyWrapper,refs,scrollTop,setScrollTop From: https://www.cnblogs.com/web-aqin/p/16613061.html