xiaocheng555 / el-table-virtual-scroll

基于Element-UI的Table 组件开发的虚拟滚动组件,支持动态高度,解决数据量大时滚动卡顿的问题。
224 stars 41 forks source link

使用二次封装的el-table时,cellFixedStyle() 方法里获取table时没有使用 getElTable() 方法获取 #68

Closed zhangruixue012 closed 6 months ago

zhangruixue012 commented 6 months ago

// 【自定义固定列】设置固定左右样式
cellFixedStyle ({ column }, isHeader = false) {
  // 这里应该是: const elTable = this.getElTable();
  const elTable = this.$children[0]

  if (!elTable) return
  // 右边固定列头部需要加上滚动条宽度-gutterWidth
  const { gutterWidth: _gutterWidth, scrollY } = elTable.layout
  const gutterWidth = isHeader && scrollY ? _gutterWidth : 0

  ......

},
xiaocheng555 commented 6 months ago
// 【自定义固定列】设置固定左右样式
cellFixedStyle ({ column }, isHeader = false) {
  // 这里应该是: const elTable = this.getElTable();
  const elTable = this.$children[0]

  if (!elTable) return
  // 右边固定列头部需要加上滚动条宽度-gutterWidth
  const { gutterWidth: _gutterWidth, scrollY } = elTable.layout
  const gutterWidth = isHeader && scrollY ? _gutterWidth : 0

  ......

},

好的,我改下

xiaocheng555 commented 6 months ago
// 【自定义固定列】设置固定左右样式
cellFixedStyle ({ column }, isHeader = false) {
  // 这里应该是: const elTable = this.getElTable();
  const elTable = this.$children[0]

  if (!elTable) return
  // 右边固定列头部需要加上滚动条宽度-gutterWidth
  const { gutterWidth: _gutterWidth, scrollY } = elTable.layout
  const gutterWidth = isHeader && scrollY ? _gutterWidth : 0

  ......

},

已修复,升级库到1.1.6