84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
It seems that writing @mousewheel has no effect, I hope God can give me some advice
小伙看你根骨奇佳,潜力无限,来学PHP伐。
Kuoyi, how did you write it specifically
Okay, I made a mistake myself, because it was added to a component tag, it should be written @mousewheel.native~~
I am effective
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
Kuoyi, how did you write it specifically
Okay, I made a mistake myself, because it was added to a component tag, it should be written @mousewheel.native~~
I am effective
You can write a command to monitor it yourself
jsbin