Fix: 修正国际化的显示、跳转问题
This commit is contained in:
@ -14,6 +14,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
interface Props {
|
||||
name: string
|
||||
description: string
|
||||
@ -23,13 +24,13 @@ interface Props {
|
||||
}
|
||||
|
||||
const props = defineProps<Props>()
|
||||
const router = useRouter()
|
||||
const localePath = useLocalePath()
|
||||
|
||||
const handleClick = () => {
|
||||
// 优先使用 slug,如果没有则使用 id
|
||||
const routeParam = props.slug || props.id
|
||||
if (routeParam) {
|
||||
router.push(`/productions/${routeParam}`)
|
||||
navigateTo(localePath(`/productions/${routeParam}`))
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user