This commit is contained in:
2023-10-16 22:31:02 +08:00
parent b5b55dc3b2
commit 4f102b8d6e
19 changed files with 605 additions and 96 deletions

View File

@@ -3,20 +3,20 @@
</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<{
const { biliInfo, userInfo } = defineProps<{
// eslint-disable-next-line @typescript-eslint/no-explicit-any
biliInfo: any | undefined
userInfo: UserInfo | undefined
}>()
const indexType = computed(() => {
if (userInfo.value) {
switch (userInfo.value.indexType) {
if (userInfo) {
switch (userInfo.indexType) {
case IndexTypes.Default:
return DefaultIndexTemplate
@@ -27,9 +27,4 @@ const indexType = computed(() => {
return DefaultIndexTemplate
}
})
const userInfo = ref<UserInfo>()
onMounted(async () => {
userInfo.value = await useUser()
})
</script>