File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -145,10 +145,10 @@ export default {
145
145
/**
146
146
* @description 初始化设置面包屑导航和标签导航
147
147
*/
148
+ this .setTagNavList ()
148
149
this .addTag ({
149
150
route: this .$store .state .app .homeRoute
150
151
})
151
- this .setTagNavList ()
152
152
this .setBreadCrumb (this .$route )
153
153
// 设置初始语言
154
154
this .setLocal (this .$i18n .locale )
Original file line number Diff line number Diff line change @@ -44,9 +44,9 @@ export default {
44
44
if ( list ) {
45
45
tagList = [ ...list ]
46
46
} else tagList = getTagNavListFromLocalstorage ( )
47
- if ( tagList [ 0 ] . name !== homeName ) tagList . shift ( )
47
+ if ( tagList [ 0 ] && tagList [ 0 ] . name !== homeName ) tagList . shift ( )
48
48
let homeTagIndex = tagList . findIndex ( item => item . name === homeName )
49
- if ( homeTagIndex !== 0 ) {
49
+ if ( homeTagIndex > 0 ) {
50
50
let homeTag = tagList . splice ( homeTagIndex , 1 ) [ 0 ]
51
51
tagList . unshift ( homeTag )
52
52
}
You can’t perform that action at this time.
0 commit comments