surmon-china / vue-awesome-swiper

🏆 Swiper component for @vuejs
https://github.surmon.me/vue-awesome-swiper
MIT License
12.82k stars 1.96k forks source link

swiper-button-next/prev doesn‘t work when I use v-if ? #574

Open GHwangxingren opened 5 years ago

GHwangxingren commented 5 years ago

when I use 'v-if' to control my button is show or not,it dosen't work to switch picture.But 'v-show' is useful.I want known the reason.

AndrewBogdanovTSS commented 4 years ago

It may be related to the fact the swiper can't find them on the init phase

surmon-china commented 4 years ago

@GHwangxingren

@AndrewBogdanovTSS is right, try not to dynamically control the conditions required for swiper instantiation.

When the component is updated, component cannot know what your intention to change is, so swiper will not be re-instantiated.