Vue-awesome-swiper: Dynamic sliders on page

Created on 20 Jun 2017  ·  2Comments  ·  Source: surmon-china/vue-awesome-swiper

Problem

I have a situation where I need multiple sliders on a page:

<div v-swiper:mySwiper="swiperOption">
<div v-for="(item, index) in slider" :key="item.slug">

Unfortunately only one of the swiper actually load as mySwiper.

Is there any way to get all the swipers to load by making mySwiper dynamic?

Most helpful comment

https://github.com/surmon-china/vue-awesome-swiper/blob/master/ssr.js#L10

<div v-swiper="swiperOption" :instanceName="'customSwiperInstanceName'">

All 2 comments

I solved this by putting each instance into it's own component.

https://github.com/surmon-china/vue-awesome-swiper/blob/master/ssr.js#L10

<div v-swiper="swiperOption" :instanceName="'customSwiperInstanceName'">

Was this page helpful?
0 / 5 - 0 ratings