vue.js: how to handle click and dblclick events on same element

后端 未结 7 2202
粉色の甜心
粉色の甜心 2021-02-01 16:01

I have a vue component with separate events for click/dblclik. Single click (de)selects row, dblclick opens edit form.

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-01 16:30

    The button above has been clicked {{ counter }} times.

    var example1 = new Vue({
     el: '#example-1',
     data: {
       counter: 0
     },
     methods: {
       funcao: function(){
         alert("Sou uma funcao");
       }
     }
    })
    

    check out this working fiddle https://codepen.io/robertourias/pen/LxVNZX

提交回复
热议问题