Vue-awesome-swiper: controller not work ssr mode

Created on 19 Aug 2019  ·  5Comments  ·  Source: surmon-china/vue-awesome-swiper

Hi I used nuxt js and use example (https://github.com/surmon-china/vue-awesome-swiper/blob/master/examples/31-thumbs-gallery-loop.vue) in project but not work in ssr mode

~~
this.$nextTick(() => {
const swiperTop = this.$refs.swiperTop;
const swiperThumbs = this.$refs.swiperThumbs;
swiperTop.controller.control = swiperThumbs
swiperThumbs.controller.control = swiperTop
})
~
~

Error:

CANNOT SET PROPERTY 'CONTROL' OF UNDEFINED

Hope this helps!

Most helpful comment

Hi. had same issue when i try to get controls from swiper.
I solved it by uninstalling latest version of "swiper" from npm (in package.json file, was isntaled "swiper": "^6....",).
Then installed older version of "swiper" by "npm i [email protected]".
PS. current version of "vue-awesome-swiper": "^4.1.1",
Maybe it helps for you

All 5 comments

ssss

Soleved:
Use:
v-swiper:mySwipper1
and
v-swiper:mySwipper2

hello @kooshkestani where add mySwipper1? changing swiperTop or what?

Hi. had same issue when i try to get controls from swiper.
I solved it by uninstalling latest version of "swiper" from npm (in package.json file, was isntaled "swiper": "^6....",).
Then installed older version of "swiper" by "npm i [email protected]".
PS. current version of "vue-awesome-swiper": "^4.1.1",
Maybe it helps for you

@pablosnwg 很感谢你

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pfasang picture pfasang  ·  5Comments

wuxiaobin1995 picture wuxiaobin1995  ·  4Comments

diveDylan picture diveDylan  ·  7Comments

cycold picture cycold  ·  3Comments

bourhaouta picture bourhaouta  ·  3Comments