From e149bdb55857ea657f6407b3f2d0d23f38f1af24 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 e3218592d..1a58fe772 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); +}