绿谷移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

73 lines
1.4 KiB

<template>
<div class="about-us d-flex">
<div
class="ml-2"
v-for="(item, index) in list" :key="index" :class="activeNum === index ? 'nav-box-active' : ''" @click="jump(item.url)"
>
{{ item.title }}
</div>
</div>
</template>
<script>
export default {
name: 'HNav',
data() {
return {
str: '导航条',
activeNum: 0,
list: [
{
title: '产业创新联盟',
url: '/Industry/Union',
},
{
title: '产业服务',
url: '/Industry/Serve',
},
{
title: '衍生企业',
url: '/Industry/Enterprise',
},
],
};
},
created() {
console.log();
if (this.$route.fullPath === '/Industry/Serve') {
this.activeNum = 1;
} else if (this.$route.fullPath === '/Industry/Enterprise') {
this.activeNum = 2;
} else {
this.activeNum = 0;
}
},
methods: {
jump(url) {
if (this.$route.fullPath === url) {
this.$message.success('已在当前界面');
} else {
this.$router.push(url);
}
},
},
};
</script>
<style lang="stylus" scoped>
.about-us{
width 100%
height 2rem
// border 1px solid pink
font-size: 16px;
padding-left 0.6rem
padding-top 0.2rem
background-color #fff
}
.nav-box-active {
color: black !important;
font-weight:bold
}
</style>