hookehuyr

✨ feat: 点击logo跳转首页

<!--
* @Date: 2024-09-26 13:42:11
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-11-07 18:09:11
* @LastEditTime: 2024-11-11 11:30:31
* @FilePath: /hager/src/components/common/hagerHeader.vue
* @Description: 文件描述
-->
......@@ -12,7 +12,7 @@
<el-col :sm="22" :md="22" :lg="18" :xl="16" style="position: relative;height: 5rem;">
<el-row>
<el-col :sm="6" :md="6" :lg="6" :xl="6">
<div class="nav-logo">
<div @click="goToHome" class="nav-logo">
<el-image style="width: 8rem; height: 2.5rem" src="https://cdn.ipadbiz.cn/hager/icon/logo@2x.png" fit="fit"></el-image>
</div>
</el-col>
......@@ -111,7 +111,7 @@
<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>
<i v-else class="el-icon-close" style="font-size: 1.15rem;"></i>
</div>
<div style="display: flex; align-items: center;">
<div @click="goToHome" style="display: flex; align-items: center;">
<img style="width: 5.3rem; height: 1.7rem" src="https://cdn.ipadbiz.cn/hager/icon/logo@2x.png">
</div>
<div>
......@@ -240,6 +240,14 @@ export default {
window.removeEventListener('resize', this.handleHeightResize);
},
methods: {
goToHome () { // 跳转到首页
this.$router.push({
path: '/',
query: {
timestamp: Date.now()
}
});
},
handleHeightResize () {
// 高度监听
this.$nextTick(() => {
......@@ -545,6 +553,9 @@ export default {
display: flex;
height: 5rem;
align-items: center;
&:hover {
cursor: pointer;
}
}
.nav-wrapper {
display: flex;
......