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 {
145145 /**
146146 * @description 初始化设置面包屑导航和标签导航
147147 */
148+ this .setTagNavList ()
148149 this .addTag ({
149150 route: this .$store .state .app .homeRoute
150151 })
151- this .setTagNavList ()
152152 this .setBreadCrumb (this .$route )
153153 // 设置初始语言
154154 this .setLocal (this .$i18n .locale )
Original file line number Diff line number Diff line change @@ -44,9 +44,9 @@ export default {
4444 if ( list ) {
4545 tagList = [ ...list ]
4646 } else tagList = getTagNavListFromLocalstorage ( )
47- if ( tagList [ 0 ] . name !== homeName ) tagList . shift ( )
47+ if ( tagList [ 0 ] && tagList [ 0 ] . name !== homeName ) tagList . shift ( )
4848 let homeTagIndex = tagList . findIndex ( item => item . name === homeName )
49- if ( homeTagIndex !== 0 ) {
49+ if ( homeTagIndex > 0 ) {
5050 let homeTag = tagList . splice ( homeTagIndex , 1 ) [ 0 ]
5151 tagList . unshift ( homeTag )
5252 }
You can’t perform that action at this time.
0 commit comments