usage scenarios:
in a vue project, there is a button.
problems encountered:
Click the output: 111. (no problem)
long press output: 111222.
want to implement:
Click the output: 111.
long press output only: 222.
how can it be implemented?
methods: {
handleClick () {
clearInterval(this.Loop)
this.Loop = setTimeout(() => {
console.log("222")
}, 1000)
console.log("111")
},
clearLoop () {
clearInterval(this.Loop)
}
}