<button
:disabled="disabledTrigger"
@click="preventDoubleClick()"
>
click!
</button>
data () {
return {
disabledTrigger: false,
}
},
methods: {
preventDoubleClick () {
let i = 1
this.disabledTrigger = true
const timer = setInterval(() => {
i = i + 1
if (i > 1) {
this.disabledTrigger = false
i = 1
clearInterval(timer)
}
}, 250)
}
}