It seems that writing @mousewheel has no effect, I hope God can give me some advice
小伙看你根骨奇佳,潛力無限,來學PHP伐。
Okay, I made a mistake myself, because it was added to a component tag, it should be written @mousewheel.native~~
You can write a command to monitor it yourself
Vue.directive('scroll', {
// 當綁定元素插入到 DOM 中
inserted: function (el,binding) {
var cb = binding.value
el.addEventListener('mousewheel',function(e){
var direction = e.deltaY>0?'down':'up'
cb(direction)
})
}
})
new Vue({
el:'#app',
methods:{
scrollFn:function(direction){
console.log(direction)
}
}
})
jsbin