vue 监听区域滚动条移动参数及分页处理

@scroll实现
首先有滚动条的div一定要设固定高度,然后overflow:auto;出现滚动条
passive是使滚动更加流畅,减少卡顿,

 

 

 

    getScroll(event) {
      // 滚动条距离底部的距离scrollBottom
      let scrollBottom =
        event.target.scrollHeight -
        event.target.scrollTop -
        event.target.clientHeight
      console.log('scrollBottom :>> ', scrollBottom)
      if (scrollBottom < 28) {
        this.currentPage += 1
        this.getPlatformInfo()
      }
    }


 

你可能感兴趣的:(vue 监听区域滚动条移动参数及分页处理)