方法一:想法是根据防抖得来的
<trmplate>
<div @click="rowClick" @dblclick="rowDblclick"></div>
</template>
<script>
export default {
data(){
return {
timer: null
}
},
methods: {
rowClick() {
clearTimeout(this.timer)
this.timer = serTimeout(()=>{
……
}, 300)
},
rowDblclick() {
clearTimeout(this.timer)
……
}
}
}
</script>