surmon-china / vue-awesome-swiper

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

use vue-awesome-swiper in vue-cli3.0 can't get the swiper instance #456

Open Activekid opened 5 years ago

Activekid commented 5 years ago

`

{{item.name||'暂无标题'}}
       <div class="swiper-button-next" slot="button-next"></div>
       <div class="swiper-button-prev" slot="button-prev"></div>
   </swiper>`
   `**this.$nextTick(() => {
            console.log('this.swiperTop',this)
            console.log('this.$refs.swiperTop.swiper',this.$refs.swiperTop.swiper)
            const swiperTop = this.$refs.swiperTop.swiper
            const swiperThumbs = this.$refs.swiperThumbs.swiper
            swiperTop.controller.control = swiperThumbs
            swiperThumbs.controller.control = swiperTop
        })**`

propblem: this.$refs.swiperTop is undefined

Activekid commented 5 years ago

2

Activekid commented 5 years ago

3

Activekid commented 5 years ago

4

Activekid commented 5 years ago

有轮播效果,this.$refs获取不到swiper 实例,实现不了双向控制

ferndot commented 4 years ago

Same issue

mouadziani commented 3 years ago

Same issue -_-

llanas commented 3 years ago

You can find solution at https://github.com/surmon-china/vue-awesome-swiper/issues/272#issuecomment-719681698