Fix: 修正国际化的显示、跳转问题
This commit is contained in:
@ -17,19 +17,19 @@
|
||||
<h4>{{ $t('quick-links') }}</h4>
|
||||
<ul class="footer-links">
|
||||
<li>
|
||||
<NuxtLink to="/">{{ $t('navigation.home') }}</NuxtLink>
|
||||
<NuxtLinkLocale to="/">{{ $t('navigation.home') }}</NuxtLinkLocale>
|
||||
</li>
|
||||
<li>
|
||||
<NuxtLink to="/productions">{{ $t('productions') }}</NuxtLink>
|
||||
<NuxtLink :to="$localePath('/productions')">{{ $t('productions') }}</NuxtLink>
|
||||
</li>
|
||||
<li>
|
||||
<NuxtLink to="/solutions">{{ $t('solutions') }}</NuxtLink>
|
||||
<NuxtLink :to="$localePath('/solutions')">{{ $t('solutions') }}</NuxtLink>
|
||||
</li>
|
||||
<li>
|
||||
<NuxtLink to="/support">{{ $t('support') }}</NuxtLink>
|
||||
<NuxtLink :to="$localePath('/support')">{{ $t('support') }}</NuxtLink>
|
||||
</li>
|
||||
<li>
|
||||
<NuxtLink to="/about">{{ $t('about-us') }}</NuxtLink>
|
||||
<NuxtLink :to="$localePath('/about')">{{ $t('about-us') }}</NuxtLink>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -79,11 +79,11 @@
|
||||
<p>备案号: 浙ICP备12003709号-5</p>
|
||||
</div>
|
||||
<div class="footer-links-bottom">
|
||||
<NuxtLink to="/privacy">{{ $t('privacy-policy') }}</NuxtLink>
|
||||
<NuxtLink :to="$localePath('/privacy')">{{ $t('privacy-policy') }}</NuxtLink>
|
||||
<span class="separator">|</span>
|
||||
<NuxtLink to="/terms">{{ $t('terms-of-service') }}</NuxtLink>
|
||||
<NuxtLink :to="$localePath('/terms')">{{ $t('terms-of-service') }}</NuxtLink>
|
||||
<span class="separator">|</span>
|
||||
<NuxtLink to="/sitemap">{{ $t('sitemap') }}</NuxtLink>
|
||||
<NuxtLink :to="$localePath('/sitemap')">{{ $t('sitemap') }}</NuxtLink>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="header-container">
|
||||
<div class="logo-section">
|
||||
<NuxtLink to="/" class="logo-link">
|
||||
<NuxtLink :to="$localePath('/')" class="logo-link">
|
||||
<el-image class="website-logo" src="/jinshen-logo.png" alt="Jinshen Logo" fit="contain" />
|
||||
</NuxtLink>
|
||||
</div>
|
||||
@ -9,16 +9,16 @@
|
||||
|
||||
<!-- 导航菜单 -->
|
||||
<el-menu default-active="productions" class="header-menu" mode="horizontal" :ellipsis="false" router>
|
||||
<el-menu-item index="/productions">
|
||||
<el-menu-item :index="$localePath('/productions')">
|
||||
<span class="title">{{ $t('productions') }}</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="/solutions">
|
||||
<el-menu-item :index="$localePath('/solutions')">
|
||||
<span class="title">{{ $t('solutions') }}</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="/support">
|
||||
<el-menu-item :index="$localePath('/support')">
|
||||
<span class="title">{{ $t('support') }}</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="/about">
|
||||
<el-menu-item :index="$localePath('/about')">
|
||||
<span class="title">{{ $t('about-us') }}</span>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
|
||||
@ -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