diff --git a/packages/client/src/pages/pages.vue b/packages/client/src/pages/pages.vue index e3218592d2..1a58fe7720 100644 --- a/packages/client/src/pages/pages.vue +++ b/packages/client/src/pages/pages.vue @@ -95,6 +95,21 @@ definePageMetadata(computed(() => ({ title: i18n.ts.pages, icon: 'fas fa-sticky-note', }))); + +let swiperRef = null; + +function setSwiperRef(swiper) { + swiperRef = swiper; + syncSlide(tabs.indexOf(tab)); +} + +function onSlideChange() { + tab = tabs[swiperRef.activeIndex]; +} + +function syncSlide(index) { + swiperRef.slideTo(index); +}