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.
59 lines
1.3 KiB
59 lines
1.3 KiB
<template>
|
|
<div class="nav-box d-flex">
|
|
<div
|
|
:class="activeNum === index ? 'nav-box-active' : ''"
|
|
:key="index"
|
|
@click="jump(item.url)"
|
|
v-for="(item, index) in list"
|
|
>{{ item.title }}</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'HNav',
|
|
data() {
|
|
return {
|
|
str: '导航条',
|
|
activeNum: 0,
|
|
list: [
|
|
{
|
|
title: '协同创新中心',
|
|
url: '/NewPlatform/NewCore',
|
|
},
|
|
{
|
|
title: '创新资源平台',
|
|
url: '/NewPlatform/News',
|
|
},
|
|
{
|
|
title: '创新服务',
|
|
url: '/NewPlatform/NewService',
|
|
},
|
|
],
|
|
};
|
|
},
|
|
created() {
|
|
console.log();
|
|
if (this.$route.fullPath === '/NewPlatform/News') {
|
|
this.activeNum = 1;
|
|
} else if (this.$route.fullPath === '/NewPlatform/Share/Institute') {
|
|
this.activeNum = 1;
|
|
} else if (this.$route.fullPath === '/NewPlatform/NewService') {
|
|
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></style>
|
|
|