diff --git a/package.json b/package.json index 95f339822..bf781b90b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "12.119.0-calc.1-rc.9.8", + "version": "12.119.0-calc.1-rc.9.9", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/pages/explore.vue b/packages/client/src/pages/explore.vue index 3edcc4325..a9a707f04 100644 --- a/packages/client/src/pages/explore.vue +++ b/packages/client/src/pages/explore.vue @@ -63,11 +63,12 @@ const props = defineProps<{ const tabs = ['featured', 'users', 'search']; -const emit = defineEmits<{ - (ev: 'update:tab', key: string); -}>(); - -let tab = $ref('featured'); +let tab = $computed({ + get: () => tabs[0], + set: (x) => { + syncSlide(tabs.indexOf(x)); + }, +}); let tagsEl = $ref>(); let searchQuery = $ref(null); let searchOrigin = $ref('combined'); @@ -108,16 +109,20 @@ definePageMetadata(computed(() => ({ let swiperRef = null; +const emit = defineEmits<{ + (ev: 'update:tab', key: string); +}>(); + function setSwiperRef(swiper) { swiperRef = swiper; syncSlide(tabs.indexOf(tab)); } function onSlideChange() { - // tab = tabs[swiperRef.activeIndex]; let theTab = tabs[swiperRef.activeIndex]; console.log(theTab); emit('update:tab', theTab); + tab = theTab; } function syncSlide(index) {