This commit is contained in:
2023-10-16 11:27:37 +08:00
parent 826f99350c
commit b5b55dc3b2
29 changed files with 951 additions and 319 deletions

View File

@@ -0,0 +1,35 @@
<template>
<component :is="indexType" :user-info="userInfo" :bili-info="biliInfo"/>
</template>
<script lang="ts" setup>
import { useUser } from '@/api/user'
import { IndexTypes } from '@/api/api-models'
import DefaultIndexTemplate from '@/views/view/indexTemplate/DefaultIndexTemplate.vue'
import { computed, onMounted, ref } from 'vue'
import { UserInfo } from '@/api/api-models'
defineProps<{
// eslint-disable-next-line @typescript-eslint/no-explicit-any
biliInfo: any | undefined
}>()
const indexType = computed(() => {
if (userInfo.value) {
switch (userInfo.value.indexType) {
case IndexTypes.Default:
return DefaultIndexTemplate
default:
return DefaultIndexTemplate
}
} else {
return DefaultIndexTemplate
}
})
const userInfo = ref<UserInfo>()
onMounted(async () => {
userInfo.value = await useUser()
})
</script>