Mouseover or hover vue.js

前端 未结 13 1676
温柔的废话
温柔的废话 2021-01-30 02:13

I would like to show a div when hovering over an element in vue.js. But I can\'t seem to get it working.

It looks like there is no event for hover or mouseover in vue.j

13条回答
  •  北恋
    北恋 (楼主)
    2021-01-30 02:33

    Here is a working example of what I think you are asking for.

    http://jsfiddle.net/1cekfnqw/3017/

     
    Show
    Hover over me!
    var demo = new Vue({ el: '#demo', data: { active: false }, methods: { mouseOver: function(){ this.active = !this.active; } } });

提交回复
热议问题