亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - How to listen to mouse wheel events in vue.js.
伊謝爾倫
伊謝爾倫 2017-07-05 11:05:40
0
4
1868

It seems that writing @mousewheel has no effect, I hope God can give me some advice

伊謝爾倫
伊謝爾倫

小伙看你根骨奇佳,潛力無限,來學PHP伐。

reply all(4)
大家講道理

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template