Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
hager
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-08-06 09:58:50 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cb90cd47c876aadb3d5f6ef9be808a6a5bb45944
cb90cd47
1 parent
b0f0d13f
feat(news): 添加新闻标题英文显示支持
在新闻详情页添加英文标题显示字段,并调整样式间距
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
src/views/news/detail.vue
src/views/news/detail.vue
View file @
cb90cd4
<!--
* @Date: 2024-10-18 12:06:09
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 202
4-12-16 10:15:10
* @LastEditTime: 202
5-08-06 09:55:51
* @FilePath: /hager/src/views/news/detail.vue
* @Description: 文件描述
-->
...
...
@@ -21,6 +21,7 @@
</hager-box>
<hager-box>
<div class="news-title">{{ title }}</div>
<div class="news-title-en">{{ title_en }}</div>
<div :class="['news-content', is_xs ? 'xs' : '']" v-html="content"></div>
</hager-box>
</div>
...
...
@@ -46,6 +47,7 @@ export default {
data () {
return {
title: '获奖+1!海格电气荣获2023酒店文旅优秀国际标杆品牌',
title_en: '',
content: '',
keyword: '',
description: '',
...
...
@@ -55,6 +57,7 @@ export default {
const { code, data } = await getNewsDetailAPI({ id: this.$route.params.id });
if (code) {
this.title = data.post_title;
this.title_en = data.post_title_en;
this.content = data.product_advantages;
this.keyword = data.post_keyword ? data.post_keyword : 'hager 海格电气 新闻';
this.description = data.post_description ? data.post_description : data.post_title;
...
...
@@ -89,7 +92,15 @@ export default {
text-align: center;
font-size: 1.75rem;
font-weight: bold;
margin: 3rem 0;
margin: 3rem 0 0 0;
}
.news-title-en {
color: @primary-color;
text-align: center;
font-size: 1.2rem;
font-weight: bold;
margin: 0 0 2rem 0;
}
:deep(.news-content) {
...
...
Please
register
or
login
to post a comment