How does vue achieve the coexistence of "long press" and "normal click" without affecting each other?

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)
    }
  }
Mar.17,2021

can be compared with the time stamp
touchstart. Record the time when touchend is compared with the current time.
if the time exceeds a certain period of time, it is regarded as a long click, and if it is not exceeded, it is regarded as clicking

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4650e-44b9d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4650e-44b9d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?