sync on mounted
This commit is contained in:
parent
6c93e0a623
commit
b072354ff7
1 changed files with 5 additions and 1 deletions
|
@ -62,7 +62,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { defineAsyncComponent, computed, watch, ref } from 'vue';
|
import { computed, watch, ref, onMounted } from 'vue';
|
||||||
import { Virtual } from 'swiper';
|
import { Virtual } from 'swiper';
|
||||||
import { Swiper, SwiperSlide } from 'swiper/vue';
|
import { Swiper, SwiperSlide } from 'swiper/vue';
|
||||||
import XTutorial from '@/components/MkTutorialDialog.vue';
|
import XTutorial from '@/components/MkTutorialDialog.vue';
|
||||||
|
@ -287,6 +287,10 @@ function syncSlide(index) {
|
||||||
swiperRef.slideTo(index);
|
swiperRef.slideTo(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
syncSlide(timelines.indexOf(swiperRef.activeIndex));
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
Loading…
Reference in a new issue