监听此div , 定义ref  
<div class="productSec" ref="rightContent" @mousewheel="scrool">
mounted: function(){
  //在mounted钩子函数绑定滚动条事件
  this.$refs.rightContent.addEventListener('scroll', this.scrool);
  
},
methods: {
  scrool(){
    console.log('===scrool===') 
    let scrolled = this.$refs.rightContent.scrollTop;
    console.log(scrolled ) 
  } 
},

 

注:只写@mousewheel="scrool"  鼠标滚动事件,不能监听到:用鼠标拖动滚动条

Logo

前往低代码交流专区

更多推荐