BUG fix: NaN

This commit is contained in:
KUN1007 2023-12-02 14:49:42 +08:00
parent 74c3bc7034
commit 98ec677b42

View file

@ -1,4 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { computed } from 'vue'
import UserPart from './UserPart.vue' import UserPart from './UserPart.vue'
import TopicPart from './TopicPart.vue' import TopicPart from './TopicPart.vue'
@ -7,14 +8,16 @@ import { HomeTopic } from '@/api'
const props = defineProps<{ const props = defineProps<{
topic: HomeTopic topic: HomeTopic
}>() }>()
const topic = computed(() => props.topic)
</script> </script>
<template> <template>
<div class="topic"> <div class="topic">
<UserPart :user="props.topic.user" /> <UserPart :user="topic.user" />
<RouterLink :to="`/topic/${props.topic.tid}`"> <RouterLink :to="`/topic/${topic.tid}`">
<TopicPart :topic="props.topic" /> <TopicPart :topic="topic" />
</RouterLink> </RouterLink>
</div> </div>
</template> </template>