hookehuyr

✨ feat: 点击logo跳转首页

1 <!-- 1 <!--
2 * @Date: 2024-09-26 13:42:11 2 * @Date: 2024-09-26 13:42:11
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-11-07 18:09:11 4 + * @LastEditTime: 2024-11-11 11:30:31
5 * @FilePath: /hager/src/components/common/hagerHeader.vue 5 * @FilePath: /hager/src/components/common/hagerHeader.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
12 <el-col :sm="22" :md="22" :lg="18" :xl="16" style="position: relative;height: 5rem;"> 12 <el-col :sm="22" :md="22" :lg="18" :xl="16" style="position: relative;height: 5rem;">
13 <el-row> 13 <el-row>
14 <el-col :sm="6" :md="6" :lg="6" :xl="6"> 14 <el-col :sm="6" :md="6" :lg="6" :xl="6">
15 - <div class="nav-logo"> 15 + <div @click="goToHome" class="nav-logo">
16 <el-image style="width: 8rem; height: 2.5rem" src="https://cdn.ipadbiz.cn/hager/icon/logo@2x.png" fit="fit"></el-image> 16 <el-image style="width: 8rem; height: 2.5rem" src="https://cdn.ipadbiz.cn/hager/icon/logo@2x.png" fit="fit"></el-image>
17 </div> 17 </div>
18 </el-col> 18 </el-col>
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
111 <el-image v-if="!show_menu" style="width: auto; height: 0.65rem" src="https://cdn.ipadbiz.cn/hager/icon/%E8%8F%9C%E5%8D%95@2x.png" fit="fit"></el-image> 111 <el-image v-if="!show_menu" style="width: auto; height: 0.65rem" src="https://cdn.ipadbiz.cn/hager/icon/%E8%8F%9C%E5%8D%95@2x.png" fit="fit"></el-image>
112 <i v-else class="el-icon-close" style="font-size: 1.15rem;"></i> 112 <i v-else class="el-icon-close" style="font-size: 1.15rem;"></i>
113 </div> 113 </div>
114 - <div style="display: flex; align-items: center;"> 114 + <div @click="goToHome" style="display: flex; align-items: center;">
115 <img style="width: 5.3rem; height: 1.7rem" src="https://cdn.ipadbiz.cn/hager/icon/logo@2x.png"> 115 <img style="width: 5.3rem; height: 1.7rem" src="https://cdn.ipadbiz.cn/hager/icon/logo@2x.png">
116 </div> 116 </div>
117 <div> 117 <div>
...@@ -240,6 +240,14 @@ export default { ...@@ -240,6 +240,14 @@ export default {
240 window.removeEventListener('resize', this.handleHeightResize); 240 window.removeEventListener('resize', this.handleHeightResize);
241 }, 241 },
242 methods: { 242 methods: {
243 + goToHome () { // 跳转到首页
244 + this.$router.push({
245 + path: '/',
246 + query: {
247 + timestamp: Date.now()
248 + }
249 + });
250 + },
243 handleHeightResize () { 251 handleHeightResize () {
244 // 高度监听 252 // 高度监听
245 this.$nextTick(() => { 253 this.$nextTick(() => {
...@@ -545,6 +553,9 @@ export default { ...@@ -545,6 +553,9 @@ export default {
545 display: flex; 553 display: flex;
546 height: 5rem; 554 height: 5rem;
547 align-items: center; 555 align-items: center;
556 + &:hover {
557 + cursor: pointer;
558 + }
548 } 559 }
549 .nav-wrapper { 560 .nav-wrapper {
550 display: flex; 561 display: flex;
......