How to get the current active slide index?
See original GitHub issuei have this simple
<swiper id="swiper-container" :options="swiperOption" @slideChange="runOnChange">
<div class="swiper-pagination" slot="pagination" v-on:slide></div>
<swiper-slide class="map">Slide 1</swiper-slide>
<swiper-slide class="scan">Slide 2</swiper-slide>
<swiper-slide class="info">Slide 3</swiper-slide>
</swipedfdfr>
And I would like to get the current active slide.
But when I run on the swiperOption
funciton mySwipe.activeIndex()
I always get a 0
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top Results From Across the Web
How to detect current slide in swiper js? - Stack Overflow
idangero.us/swiper/api/#.VhJDi_mqpHw In this page we can use > mySwiper.activeIndex Index number of currently active slide Note, that in loop mode active index ......
Read more >how to get current slide element index in swiper js react
With swiper.activeIndex you are accessing the virtual slides, just use swiper.realIndex for the real index. Open side panel.
Read more >Using .last() to check if we're on the last slide - Codecademy
What I'd like to know though is if there is a way to use the jQuery method .last() to check if the current...
Read more >Carousel issue : activeSlide doesnt work properly
Dear Szar, You can get index of current active slide by using ViewChildren decorator. Please check my code: .ts: import { Component, AfterContentChecked ......
Read more >Swiper API
To get vanilla HTMLElement use swiper.wrapperEl. swiper.activeIndex, number. Index number of currently active slide. Note, that in loop mode active index ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
you can add a event then easy to get it on v3.1.3,like this:
<swiper :options="swiperOption" @slideChange="changeSwiperIndex" ref="mySwiper">
and set a mothods like thischangeSwiperIndex () { return this.$refs.mySwiper.swiper.activeIndex }
ok, it took a bit of time but in the end I made it work this is my final code if someone needs it