vue-awesome-swiper icon indicating copy to clipboard operation
vue-awesome-swiper copied to clipboard

How to destroy an active listener?

Open gabrielsze opened this issue 4 years ago • 1 comments

Hi all,

I created a listener as such

this.$refs.mySwiperMap.$swiper.on("slideNextTransitionEnd", () => {

and now I'm trying to destroy it. (to recreate a new one, so that it doesn't duplicate)

According to the documentation (https://swiperjs.com/api/), I can use mySwiper.detachEvents(), but I have tried the following but doesn't work for me (many duplicates events firing on slide change)

  • this.$refs.mySwiperMap.$swiper.detachEvents()
  • this.$refs.mySwiperMap.detachEvents()

I am wondering how do I go about removing the swiper listener?

Dep ├── [email protected] ├── [email protected]

gabrielsze avatar Dec 22 '20 09:12 gabrielsze

this.$refs.mySwiperMap.$swiper.off("slideNextTransitionEnd")

rolandszpond avatar Mar 05 '21 07:03 rolandszpond