BUG fix: router
This commit is contained in:
parent
ead8e42bf5
commit
4ec4eb3222
|
@ -9,7 +9,7 @@ export interface TopicAsideOtherTagRequestData {
|
|||
// 本话题的 tags
|
||||
tags: string[]
|
||||
// 当前话题的 tid,因为相同标签下的其它话题不包括本话题
|
||||
tid: string
|
||||
tid: number
|
||||
}
|
||||
|
||||
export interface TopicAsideMasterRequestData {
|
||||
|
|
|
@ -18,8 +18,9 @@ import KUNGalgameTopBar from '@/components/top-bar/KUNGalgameTopBar.vue'
|
|||
<RouterView #default="{ route, Component }">
|
||||
<!-- <Transition
|
||||
:enter-active-class="`animate__animated ${route.meta.transition}`"
|
||||
> -->
|
||||
<component :is="Component"></component>
|
||||
> -->
|
||||
<!-- 坑!这里必须要加 key,不然同一界面 vue router 会识别不出来页面的更新,导致页面不刷新 -->
|
||||
<component :is="Component" :key="route.fullPath"></component>
|
||||
<!-- </Transition> -->
|
||||
</RouterView>
|
||||
</div>
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Icon } from '@iconify/vue'
|
|||
import KUNGalgameSearchBox from '@/components/KUNGalgameSearchBox.vue'
|
||||
import SortTopic from './SortTopic.vue'
|
||||
|
||||
const category = `["Galgame"]`
|
||||
const category = ['Galgame']
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -24,8 +24,6 @@ const { uid } = storeToRefs(useKUNGalgameUserStore())
|
|||
const topicData = ref<TopicAside[]>()
|
||||
|
||||
onMounted(async () => {
|
||||
console.log(tid)
|
||||
|
||||
topicData.value = (
|
||||
await useKUNGalgameTopicStore().getPopularTopicsByUserUid({
|
||||
uid: uid.value,
|
||||
|
|
|
@ -2,31 +2,31 @@
|
|||
这里是楼主的其他话题组件
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { ref, onMounted, toRaw } from 'vue'
|
||||
|
||||
import { TopicAside } from '@/api/index'
|
||||
|
||||
// 导入 topic store
|
||||
import { useKUNGalgameTopicStore } from '@/store/modules/topic'
|
||||
|
||||
import { RouterLink, useRoute } from 'vue-router'
|
||||
import { useRoute } from 'vue-router'
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const tid = route.params.tid as string
|
||||
const tid = parseInt(route.params.tid as string)
|
||||
|
||||
const props = defineProps<{
|
||||
tags: string[]
|
||||
}>()
|
||||
|
||||
const tags = toRaw(props.tags)
|
||||
|
||||
const topicData = ref<TopicAside[]>()
|
||||
|
||||
onMounted(async () => {
|
||||
console.log(tid)
|
||||
|
||||
topicData.value = (
|
||||
await useKUNGalgameTopicStore().getRelatedTopicsByTags({
|
||||
tags: props.tags,
|
||||
tags: tags,
|
||||
tid: tid,
|
||||
})
|
||||
).data
|
||||
|
|
Loading…
Reference in a new issue