hookehuyr

网站标题显示优化

1 <!-- 1 <!--
2 * @Date: 2024-09-26 13:36:06 2 * @Date: 2024-09-26 13:36:06
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-11-04 14:02:06 4 + * @LastEditTime: 2024-11-04 16:43:27
5 * @FilePath: /hager/src/App.vue 5 * @FilePath: /hager/src/App.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -23,7 +23,7 @@ import mixin from '@/common/mixin'; ...@@ -23,7 +23,7 @@ import mixin from '@/common/mixin';
23 export default { 23 export default {
24 // TAG:配置页面meta和标题信息 24 // TAG:配置页面meta和标题信息
25 metaInfo: { 25 metaInfo: {
26 - title: '海格电气官方网站', 26 + // title: '海格电气官方网站',
27 meta: [ 27 meta: [
28 { name: 'keyword', content: '海格集团是全球领先的电气及智能化解决方案和服务提供商,应用领域涵盖住宅、商业建筑、公共建筑和工业。海格电气品牌代表了集团的核心业务,覆盖配电系统、电缆管理系统,KNX 智能控制系统和开关面板、楼宇自动化和安防系统。' }, 28 { name: 'keyword', content: '海格集团是全球领先的电气及智能化解决方案和服务提供商,应用领域涵盖住宅、商业建筑、公共建筑和工业。海格电气品牌代表了集团的核心业务,覆盖配电系统、电缆管理系统,KNX 智能控制系统和开关面板、楼宇自动化和安防系统。' },
29 { name: 'description', content: '构建未来电气世界 让人们的生活更安全、更清洁、更愉悦。' }, 29 { name: 'description', content: '构建未来电气世界 让人们的生活更安全、更清洁、更愉悦。' },
......
1 /* 1 /*
2 * @Date: 2022-07-26 09:49:54 2 * @Date: 2022-07-26 09:49:54
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-11-04 11:27:34 4 + * @LastEditTime: 2024-11-04 16:43:21
5 * @FilePath: /hager/src/common/mixin.js 5 * @FilePath: /hager/src/common/mixin.js
6 * @Description: 文件描述 6 * @Description: 文件描述
7 */ 7 */
...@@ -12,7 +12,7 @@ export default { ...@@ -12,7 +12,7 @@ export default {
12 // 初始化设置 12 // 初始化设置
13 init: { 13 init: {
14 mounted () { 14 mounted () {
15 - // document.title = this.$route.meta.title; 15 + document.title = this.$route.meta.title;
16 // 页面进入时获取当前屏幕宽度 16 // 页面进入时获取当前屏幕宽度
17 this.handleResize(); 17 this.handleResize();
18 // 监听窗口的 resize 事件 18 // 监听窗口的 resize 事件
......
1 /* 1 /*
2 * @Date: 2024-08-26 10:42:15 2 * @Date: 2024-08-26 10:42:15
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-11-04 12:50:25 4 + * @LastEditTime: 2024-11-04 16:51:13
5 * @FilePath: /hager/src/route.js 5 * @FilePath: /hager/src/route.js
6 * @Description: 文件描述 6 * @Description: 文件描述
7 */ 7 */
...@@ -10,7 +10,7 @@ export default [{ ...@@ -10,7 +10,7 @@ export default [{
10 name: '首页', 10 name: '首页',
11 component: () => import('@/views/index'), 11 component: () => import('@/views/index'),
12 meta: { 12 meta: {
13 - title: '海格电气', 13 + title: '首页 | Hager China',
14 tag: 'index' 14 tag: 'index'
15 }, 15 },
16 children: [] 16 children: []
...@@ -64,7 +64,7 @@ export default [{ ...@@ -64,7 +64,7 @@ export default [{
64 name: '关于海格', 64 name: '关于海格',
65 component: () => import('@/views/about'), 65 component: () => import('@/views/about'),
66 meta: { 66 meta: {
67 - title: '海格电气', 67 + title: '关于海格 | Hager China',
68 tag: 'about' 68 tag: 'about'
69 }, 69 },
70 children: [] 70 children: []
...@@ -73,7 +73,7 @@ export default [{ ...@@ -73,7 +73,7 @@ export default [{
73 name: '海格全球', 73 name: '海格全球',
74 component: () => import('@/views/about/global'), 74 component: () => import('@/views/about/global'),
75 meta: { 75 meta: {
76 - title: '海格电气', 76 + title: '海格全球 | Hager China',
77 tag: 'about' 77 tag: 'about'
78 }, 78 },
79 children: [] 79 children: []
...@@ -82,7 +82,7 @@ export default [{ ...@@ -82,7 +82,7 @@ export default [{
82 name: '海格电气在中国', 82 name: '海格电气在中国',
83 component: () => import('@/views/about/china'), 83 component: () => import('@/views/about/china'),
84 meta: { 84 meta: {
85 - title: '海格电气', 85 + title: '海格电气在中国 | Hager China',
86 tag: 'about' 86 tag: 'about'
87 }, 87 },
88 children: [] 88 children: []
...@@ -91,7 +91,7 @@ export default [{ ...@@ -91,7 +91,7 @@ export default [{
91 name: '创新设计', 91 name: '创新设计',
92 component: () => import('@/views/about/design'), 92 component: () => import('@/views/about/design'),
93 meta: { 93 meta: {
94 - title: '海格电气', 94 + title: '创新设计 | Hager China',
95 tag: 'about' 95 tag: 'about'
96 }, 96 },
97 children: [] 97 children: []
...@@ -100,7 +100,7 @@ export default [{ ...@@ -100,7 +100,7 @@ export default [{
100 name: '生产研发', 100 name: '生产研发',
101 component: () => import('@/views/about/product'), 101 component: () => import('@/views/about/product'),
102 meta: { 102 meta: {
103 - title: '海格电气', 103 + title: '生产研发 | Hager China',
104 tag: 'about' 104 tag: 'about'
105 }, 105 },
106 children: [] 106 children: []
...@@ -109,7 +109,7 @@ export default [{ ...@@ -109,7 +109,7 @@ export default [{
109 name: '可持续发展', 109 name: '可持续发展',
110 component: () => import('@/views/about/development'), 110 component: () => import('@/views/about/development'),
111 meta: { 111 meta: {
112 - title: '海格电气', 112 + title: '可持续发展 | Hager China',
113 tag: 'about' 113 tag: 'about'
114 }, 114 },
115 children: [] 115 children: []
...@@ -118,7 +118,7 @@ export default [{ ...@@ -118,7 +118,7 @@ export default [{
118 name: '荣誉展示', 118 name: '荣誉展示',
119 component: () => import('@/views/about/honors'), 119 component: () => import('@/views/about/honors'),
120 meta: { 120 meta: {
121 - title: '海格电气', 121 + title: '荣誉展示 | Hager China',
122 tag: 'about' 122 tag: 'about'
123 }, 123 },
124 children: [] 124 children: []
...@@ -127,7 +127,7 @@ export default [{ ...@@ -127,7 +127,7 @@ export default [{
127 name: '联系我们', 127 name: '联系我们',
128 component: () => import('@/views/concat'), 128 component: () => import('@/views/concat'),
129 meta: { 129 meta: {
130 - title: '海格电气', 130 + title: '联系我们 | Hager China',
131 tag: 'concat' 131 tag: 'concat'
132 }, 132 },
133 children: [] 133 children: []
...@@ -136,7 +136,7 @@ export default [{ ...@@ -136,7 +136,7 @@ export default [{
136 name: '新闻中心', 136 name: '新闻中心',
137 component: () => import('@/views/news/index'), 137 component: () => import('@/views/news/index'),
138 meta: { 138 meta: {
139 - title: '海格电气', 139 + title: '新闻中心 | Hager China',
140 tag: 'news' 140 tag: 'news'
141 }, 141 },
142 children: [] 142 children: []
...@@ -145,7 +145,7 @@ export default [{ ...@@ -145,7 +145,7 @@ export default [{
145 name: '新闻详情', 145 name: '新闻详情',
146 component: () => import('@/views/news/detail'), 146 component: () => import('@/views/news/detail'),
147 meta: { 147 meta: {
148 - title: '海格电气', 148 + title: '新闻详情 | Hager China',
149 tag: 'news' 149 tag: 'news'
150 }, 150 },
151 children: [] 151 children: []
...@@ -154,7 +154,7 @@ export default [{ ...@@ -154,7 +154,7 @@ export default [{
154 name: '招聘信息', 154 name: '招聘信息',
155 component: () => import('@/views/recruit'), 155 component: () => import('@/views/recruit'),
156 meta: { 156 meta: {
157 - title: '海格电气', 157 + title: '招聘信息 | Hager China',
158 tag: 'recruit' 158 tag: 'recruit'
159 }, 159 },
160 children: [] 160 children: []
...@@ -163,7 +163,7 @@ export default [{ ...@@ -163,7 +163,7 @@ export default [{
163 name: '用户管理', 163 name: '用户管理',
164 component: () => import('@/views/user/index'), 164 component: () => import('@/views/user/index'),
165 meta: { 165 meta: {
166 - title: '海格电气', 166 + title: '用户管理 | Hager China',
167 tag: 'user' 167 tag: 'user'
168 }, 168 },
169 children: [ 169 children: [
...@@ -172,7 +172,7 @@ export default [{ ...@@ -172,7 +172,7 @@ export default [{
172 name: '用户登录', 172 name: '用户登录',
173 component: () => import('@/views/user/login'), 173 component: () => import('@/views/user/login'),
174 meta: { 174 meta: {
175 - title: '海格电气', 175 + title: '用户登录 | Hager China',
176 tag: 'login' 176 tag: 'login'
177 }, 177 },
178 }, 178 },
...@@ -181,7 +181,7 @@ export default [{ ...@@ -181,7 +181,7 @@ export default [{
181 name: '用户注册', 181 name: '用户注册',
182 component: () => import('@/views/user/register'), 182 component: () => import('@/views/user/register'),
183 meta: { 183 meta: {
184 - title: '海格电气', 184 + title: '用户注册 | Hager China',
185 tag: 'register' 185 tag: 'register'
186 }, 186 },
187 }, 187 },
...@@ -190,7 +190,7 @@ export default [{ ...@@ -190,7 +190,7 @@ export default [{
190 name: '用户信息', 190 name: '用户信息',
191 component: () => import('@/views/user/info'), 191 component: () => import('@/views/user/info'),
192 meta: { 192 meta: {
193 - title: '海格电气', 193 + title: '用户信息 | Hager China',
194 tag: 'info' 194 tag: 'info'
195 }, 195 },
196 }, 196 },
...@@ -199,7 +199,7 @@ export default [{ ...@@ -199,7 +199,7 @@ export default [{
199 name: '密码重置', 199 name: '密码重置',
200 component: () => import('@/views/user/reset'), 200 component: () => import('@/views/user/reset'),
201 meta: { 201 meta: {
202 - title: '海格电气', 202 + title: '密码重置 | Hager China',
203 tag: 'reset' 203 tag: 'reset'
204 }, 204 },
205 }, 205 },
...@@ -209,7 +209,7 @@ export default [{ ...@@ -209,7 +209,7 @@ export default [{
209 name: '搜索结果', 209 name: '搜索结果',
210 component: () => import('@/views/search'), 210 component: () => import('@/views/search'),
211 meta: { 211 meta: {
212 - title: '海格电气', 212 + title: '搜索结果 | Hager China',
213 tag: 'search' 213 tag: 'search'
214 }, 214 },
215 children: [] 215 children: []
......
1 <!-- 1 <!--
2 * @Date: 2024-09-29 14:26:41 2 * @Date: 2024-09-29 14:26:41
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-11-01 18:35:31 4 + * @LastEditTime: 2024-11-04 16:48:49
5 * @FilePath: /hager/src/views/product/detail.vue 5 * @FilePath: /hager/src/views/product/detail.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -250,6 +250,8 @@ export default { ...@@ -250,6 +250,8 @@ export default {
250 break; 250 break;
251 } 251 }
252 } 252 }
253 + // 设置页面标题
254 + document.title = this.info.product_name + ' | Hager China';
253 } 255 }
254 }, 256 },
255 onClick (v) { 257 onClick (v) {
......
1 <!-- 1 <!--
2 * @Date: 2024-09-27 16:53:09 2 * @Date: 2024-09-27 16:53:09
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-11-01 17:43:50 4 + * @LastEditTime: 2024-11-04 16:48:01
5 * @FilePath: /hager/src/views/product/index.vue 5 * @FilePath: /hager/src/views/product/index.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -123,6 +123,8 @@ export default { ...@@ -123,6 +123,8 @@ export default {
123 // 获取当前类别的内容 123 // 获取当前类别的内容
124 this.cate_id = info.category_parent ? info.category_parent : info.id; // 同一个值,在不同层级下名字不一样 124 this.cate_id = info.category_parent ? info.category_parent : info.id; // 同一个值,在不同层级下名字不一样
125 this.getCurrentCate(this.cate_id); 125 this.getCurrentCate(this.cate_id);
126 + // 设置页面标题
127 + document.title = this.category_name + ' | Hager China';
126 } 128 }
127 }, 129 },
128 async getCurrentCate (cate_id) { 130 async getCurrentCate (cate_id) {
......