better-scroll在PC端使用,鼠标无法实现滚动的解决办法

查阅了官方文档才知道,需要加一个属性才行

mouseWheel: true
const bScroll=new BScroll(document.querySelector('.wrapper'),{
    
    
    probeType:3,
    mouseWheel: true
  });
  bScroll.on("scroll",(position)=>{
    
    
    console.log(position);
  })

猜你喜欢

转载自blog.csdn.net/dwjdj/article/details/111752887