bindEvents() {
const vm = this
DEFAULT_EVENTS.forEach(eventName => {
this.swiper.on(eventName, function() {
// here click or tap event will be emit twice
vm.$emit(eventName, ...arguments)
vm.$emit(eventName.replace(/([A-Z])/g, '-$1').toLowerCase(), ...arguments)
})
})
}
如果是在 Webpack 的项目中,使用驼峰事件名称监听。
@cycold I had a similar issue with a @click event being emitted 3 times, and fixed it by using @click.native="myMethod()"
Hello.
same problem with @tap or @click event,
<swiper ref="mySwiper" @tap="myTapEvent">
methods: {
myTapEvent(event) {
console.log(event) // => emitted twice...
}
}
and i don't understand how #286 @weineel fix this issue?
Any ideas?
Most helpful comment
@cycold I had a similar issue with a @click event being emitted 3 times, and fixed it by using
@click.native="myMethod()"