mounted(){//在生命周期函数mounted中
    console.log(this.$refs.veriface,'智能切分滚动组件实例')//具有滚动条的dom元素,
    this.$refs.veriface.addEventListener('scroll', (e)=>{
        // console.log(e,'滚动条滚动触发')
        var scrollTop = e.target.scrollTop
        var windowHeight = e.target.clientHeight
        var scrollHeight = e.target.scrollHeight
        console.log(scrollTop,windowHeight,scrollHeight,'123')
        if(scrollTop+windowHeight == scrollHeight){
            // 当前滚动条已经触底
            this.isNoMore = true
        } else {
            this.isNoMore = false
        }
    });
  },

Logo

前往低代码交流专区

更多推荐