From 09996374e472af77a1b203a430f2a0107387ee57 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Fri, 9 Sep 2022 15:51:43 -0700 Subject: [PATCH] fix: :bug: add script to pages view --- packages/client/src/pages/pages.vue | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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); +}