vue element is bound to the same click and double-click the event dblclick, double-click the event dblclick invalid does not trigger settlement

Sometimes vue project either v-ondblclick; or @dblclick, sometimes no effect. Solutions directly on the code to look up.

Native event .native mainly used to monitor the components of the root element

 @ Dblclick.native = dblclick sometimes can be the perfect solution to the problem invalid

<div class="grid-content">
    <el-button 
    v-for="(item,index) in items" :key="index" 
   @click="storageCount(item.id)" 
   @dblclick.native="storageDetail(item.id)" 
    class="inline-cell" 
   :class="colors[item.status]">
           {{item.id}}</el-button>
 </div>

 

Released nine original articles · won praise 4 · Views 6557

Guess you like

Origin blog.csdn.net/zzsjsp/article/details/104515782