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
2024-12-11 10:14:21 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
df715a51baa94d36897cd70d5f1d23f15e7fb957
df715a51
1 parent
d58150ec
修改导航栏为a标签跳转
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
src/components/common/hagerHeader.vue
src/components/common/hagerHeader.vue
View file @
df715a5
<!--
* @Date: 2024-09-26 13:42:11
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-12-1
0 16:12:19
* @LastEditTime: 2024-12-1
1 10:11:23
* @FilePath: /hager/src/components/common/hagerHeader.vue
* @Description: 文件描述
-->
...
...
@@ -57,12 +57,18 @@
<el-image 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>
<span @mouseenter="onClickProduct">产品中心</span>
</div>
<div :class="[is_active === 'solution' ? 'active' : '', 'item']" @click="goTo('/solution/index')">解决方案</div>
<
!-- <
div :class="[is_active === 'solution' ? 'active' : '', 'item']" @click="goTo('/solution/index')">解决方案</div>
<div :class="[is_active === 'news' ? 'active' : '', 'item']" @click="goTo('/news')">新闻中心</div>
<div :class="[is_active === 'recruit' ? 'active' : '', 'item']" @click="goTo('/recruit')">招聘信息</div>
<div :class="[is_active === 'about' ? 'active' : '', 'item']" @click="goTo('/about')">关于海格</div>
<div :class="[is_active === 'contact' ? 'active' : '', 'item']" @click="goTo('/contact')">联系我们</div>
<div :class="[is_active === 'index' ? 'active' : '', 'item']" @click="goTo('/')">首页</div>
<div :class="[is_active === 'index' ? 'active' : '', 'item']" @click="goTo('/')">首页</div> -->
<a :class="[is_active === 'solution' ? 'active' : '', 'item']" :href="`${baseUrl}#/solution/index`" @click="goTo('/solution/index')">解决方案</a>
<a :class="[is_active === 'news' ? 'active' : '', 'item']" :href="`${baseUrl}#/news`" @click="goTo('/news')">新闻中心</a>
<a :class="[is_active === 'recruit' ? 'active' : '', 'item']" :href="`${baseUrl}#/recruit`" @click="goTo('/recruit')">招聘信息</a>
<a :class="[is_active === 'about' ? 'active' : '', 'item']" :href="`${baseUrl}#/about`" @click="goTo('/about')">关于海格</a>
<a :class="[is_active === 'contact' ? 'active' : '', 'item']" :href="`${baseUrl}#/contact`" @click="goTo('/contact')">联系我们</a>
<a :class="[is_active === 'index' ? 'active' : '', 'item']" :href="`${baseUrl}#/`" @click="goTo('/')">首页</a>
</div>
</el-col>
</el-row>
...
...
@@ -201,6 +207,11 @@ export default {
this.$emit('onShowMenu', val)
}
},
computed: {
baseUrl () {
return location.origin + location.pathname;
}
},
async mounted () {
const { code, data } = await getProductMenuAPI();
if (code) {
...
...
@@ -351,11 +362,11 @@ export default {
this.show = false;
},
goTo (path) { // 跳转页面
if (this.$route.path !== path) { // 不能重复点击当前页面
this.$router.push({
path,
});
}
//
if (this.$route.path !== path) { // 不能重复点击当前页面
//
this.$router.push({
//
path,
//
});
//
}
if (path.indexOf('/solution') === -1) { // 不统计解决方案页面
// TAG: 统计埋点
this.maEvent(`h5_${path.slice(1)}`);
...
...
@@ -568,6 +579,7 @@ export default {
// justify-content: space-around;
margin-top: 1.25rem;
.item {
text-decoration: none;
color: @secondary-color;
margin-right: 1.5rem;
font-size: 0.95rem;
...
...
Please
register
or
login
to post a comment