Skip to content

Commit

Permalink
修复标签导航bug
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Oct 11, 2018
1 parent 3bcb620 commit 70dffc7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/main/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ export default {
/**
* @description 初始化设置面包屑导航和标签导航
*/
this.setTagNavList()
this.addTag({
route: this.$store.state.app.homeRoute
})
this.setTagNavList()
this.setBreadCrumb(this.$route)
// 设置初始语言
this.setLocal(this.$i18n.locale)
Expand Down
4 changes: 2 additions & 2 deletions src/store/module/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ export default {
if (list) {
tagList = [...list]
} else tagList = getTagNavListFromLocalstorage()
if (tagList[0].name !== homeName) tagList.shift()
if (tagList[0] && tagList[0].name !== homeName) tagList.shift()
let homeTagIndex = tagList.findIndex(item => item.name === homeName)
if (homeTagIndex !== 0) {
if (homeTagIndex > 0) {
let homeTag = tagList.splice(homeTagIndex, 1)[0]
tagList.unshift(homeTag)
}
Expand Down

0 comments on commit 70dffc7

Please sign in to comment.