Use the better-scroll @ click event in vue to execute twice, and ask for your help to solve the problem.

Use the better-scroll @ click event in

vue to execute twice, how to solve

Mar.24,2021

has also had this problem. Note:
initially thought it was in conflict with fastclick in the project, but later confirmed that it was not caused by this reason. The
official website Demo does not have a similar problem. Finally, it is temporarily changed to @ touchstart + @ touchend.stop.prevent to simulate @ click .
sample code:

<template>
  <button @touchstart="start($event)" @touchend.stop.prevent="stop($event)">Test</button>
</template>

<script>
  export default {
    methods: {
      start ($event) {
        this.startY = $event.touches[0].pageY
      },
      stop ($event) {
        const moving = Math.abs($event.changedTouches[0].pageY - this.startY)
        if (moving > 20) return
        this.startY = 0
        console.log('click')
      }
    }
  }
</script>

@ click.native


problem solved the upstairs method is feasible


@ click.native directly report an error


this method can also be used to trigger 2 clicks
< button Vignon br. Stop.principent= "onClick" > < / button >

Menu