0👍
You can add eventListner
on resize
like following and destroySwiper
can be method which will take care of your logic on how to destroy swiper slider:
ready: function () {
window.addEventListener('resize', this.destroySwiper)
},
beforeDestroy: function () {
window.removeEventListener('resize', this.destroySwiper)
}
- [Vuejs]-Cannot use my compiled single file component
- [Vuejs]-Evaluating an array within array in VueJS
0👍
You can add a ref to your template first, then access the swiper instance on that ref to destroy
this.$refs[yourRef].$swiper.destroy()
Source:stackexchange.com