ripping my hair out

This commit is contained in:
ThatOneCalculator 2022-10-25 12:08:48 -07:00
parent 30df6ae75b
commit 373bcf9464
2 changed files with 12 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "calckey", "name": "calckey",
"version": "12.119.0-calc.1-rc.9.8", "version": "12.119.0-calc.1-rc.9.9",
"codename": "aqua", "codename": "aqua",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -63,11 +63,12 @@ const props = defineProps<{
const tabs = ['featured', 'users', 'search']; const tabs = ['featured', 'users', 'search'];
const emit = defineEmits<{ let tab = $computed({
(ev: 'update:tab', key: string); get: () => tabs[0],
}>(); set: (x) => {
syncSlide(tabs.indexOf(x));
let tab = $ref('featured'); },
});
let tagsEl = $ref<InstanceType<typeof MkFolder>>(); let tagsEl = $ref<InstanceType<typeof MkFolder>>();
let searchQuery = $ref(null); let searchQuery = $ref(null);
let searchOrigin = $ref('combined'); let searchOrigin = $ref('combined');
@ -108,16 +109,20 @@ definePageMetadata(computed(() => ({
let swiperRef = null; let swiperRef = null;
const emit = defineEmits<{
(ev: 'update:tab', key: string);
}>();
function setSwiperRef(swiper) { function setSwiperRef(swiper) {
swiperRef = swiper; swiperRef = swiper;
syncSlide(tabs.indexOf(tab)); syncSlide(tabs.indexOf(tab));
} }
function onSlideChange() { function onSlideChange() {
// tab = tabs[swiperRef.activeIndex];
let theTab = tabs[swiperRef.activeIndex]; let theTab = tabs[swiperRef.activeIndex];
console.log(theTab); console.log(theTab);
emit('update:tab', theTab); emit('update:tab', theTab);
tab = theTab;
} }
function syncSlide(index) { function syncSlide(index) {