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.
70 lines
2.0 KiB
70 lines
2.0 KiB
<template> |
|
<div class="header_tab" v-show="hideSidebar"> |
|
<el-tabs v-model="activeName" @tab-click="tabChange"> |
|
<el-tab-pane v-for="(tab,index) in tabList" :key="index" :label="tab.title" :name="tab.index"></el-tab-pane> |
|
</el-tabs> |
|
</div> |
|
</template> |
|
|
|
<script> |
|
export default { |
|
data() { |
|
return { |
|
activeName: this.$route.path, |
|
tabList: [ |
|
{ |
|
icon: 'el-icon-folder-checked', |
|
index: '/index/list', |
|
title: '我的首页' |
|
}, |
|
{ |
|
icon: 'el-icon-lx-home', |
|
index: '/practice/list', |
|
title: '我的练习' |
|
}, |
|
{ |
|
icon: 'el-icon-lx-cascades', |
|
index: '/exam/list', |
|
title: '我的考试' |
|
}, |
|
{ |
|
icon: 'el-icon-lx-copy', |
|
index: '/achievement/list', |
|
title: '我的成绩' |
|
}, |
|
{ |
|
icon: 'el-icon-lx-copy', |
|
index: '/wrongBook/list', |
|
title: '错题练习' |
|
}, |
|
{ |
|
icon: 'el-icon-chat-dot-round', |
|
index: '/messageBoard/list', |
|
title: '交流互动' |
|
} |
|
], |
|
hideNavList: ['article','matchDetail','courseSection','personalCenter'] |
|
}; |
|
}, |
|
computed: { |
|
hideSidebar() { |
|
let route = this.$route.name |
|
if(this.hideNavList.includes(route)) return false |
|
return true |
|
} |
|
}, |
|
methods: { |
|
tabChange(tab){ |
|
location.hash = tab.name |
|
this.$router.push(tab.name) |
|
}, |
|
} |
|
}; |
|
</script> |
|
|
|
<style lang="scss" scoped> |
|
/deep/.el-tabs__item:focus{ |
|
outline: none; |
|
box-shadow: none !important; |
|
} |
|
</style>
|
|
|