修复标签导航bug
This commit is contained in:
parent
3bcb620f66
commit
70dffc7767
|
|
@ -145,10 +145,10 @@ export default {
|
||||||
/**
|
/**
|
||||||
* @description 初始化设置面包屑导航和标签导航
|
* @description 初始化设置面包屑导航和标签导航
|
||||||
*/
|
*/
|
||||||
|
this.setTagNavList()
|
||||||
this.addTag({
|
this.addTag({
|
||||||
route: this.$store.state.app.homeRoute
|
route: this.$store.state.app.homeRoute
|
||||||
})
|
})
|
||||||
this.setTagNavList()
|
|
||||||
this.setBreadCrumb(this.$route)
|
this.setBreadCrumb(this.$route)
|
||||||
// 设置初始语言
|
// 设置初始语言
|
||||||
this.setLocal(this.$i18n.locale)
|
this.setLocal(this.$i18n.locale)
|
||||||
|
|
|
||||||
|
|
@ -44,9 +44,9 @@ export default {
|
||||||
if (list) {
|
if (list) {
|
||||||
tagList = [...list]
|
tagList = [...list]
|
||||||
} else tagList = getTagNavListFromLocalstorage()
|
} 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)
|
let homeTagIndex = tagList.findIndex(item => item.name === homeName)
|
||||||
if (homeTagIndex !== 0) {
|
if (homeTagIndex > 0) {
|
||||||
let homeTag = tagList.splice(homeTagIndex, 1)[0]
|
let homeTag = tagList.splice(homeTagIndex, 1)[0]
|
||||||
tagList.unshift(homeTag)
|
tagList.unshift(homeTag)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue