feat(demo-vue): 新闻页面与行业动态页面新增多语言支持
- 升级组件与页面,支持根据语言环境(中/英)条件渲染标题与内容 - 在 IndustryNews 和 News 实体类中新增英文标题、英文内容字段 - sql导出demo_news_full_dump_utf8mb4_2026-04-28.sql
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
<section class="detail-section" v-loading="loading">
|
||||
<div class="detail-wrapper">
|
||||
<article class="article-content">
|
||||
<h1 class="article-title">{{ industryDetail.title }}</h1>
|
||||
<h1 class="article-title">{{ locale === 'en-US' && industryDetail.titleEn ? industryDetail.titleEn : industryDetail.title }}</h1>
|
||||
<div class="article-meta">
|
||||
<span class="meta-item">
|
||||
<el-icon><Calendar /></el-icon>
|
||||
@@ -36,7 +36,7 @@
|
||||
{{ t('common.viewsLabel') }}{{ industryDetail.views }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="article-body" v-html="industryDetail.content"></div>
|
||||
<div class="article-body" v-html="locale === 'en-US' && industryDetail.contentEn ? industryDetail.contentEn : industryDetail.content"></div>
|
||||
</article>
|
||||
|
||||
<div class="back-button">
|
||||
@@ -65,7 +65,7 @@ import { industryApi } from '@/api/industry-api.ts'
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const { t } = useI18n()
|
||||
const { t, locale } = useI18n()
|
||||
|
||||
// 行业动态详情数据
|
||||
const industryDetail = ref<any>({
|
||||
|
||||
Reference in New Issue
Block a user