directives : {
    loadmore : {
      bind(el, binding) {
        const selectWrap = el.querySelector('.el-table__body-wrapper')
        selectWrap.addEventListener('scroll', function() {
          let sign = 0
          const scrollDistance = this.scrollHeight - this.scrollTop - this.clientHeight
          if (scrollDistance <= sign) {
            binding.value()
          }
        })
      }
    }
  },

// 自定义指令后,在el-table标签下使用v-loadmore

 <el-table v-loadmore="loadMore"  >
</el-table>

  

 

// 方法
 loadMore () {
      this.page++
},

  

  

相关文章:

  • 2021-11-27
  • 2021-12-01
  • 2022-01-02
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
  • 2022-12-23
  • 2021-11-26
相关资源
相似解决方案