File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
src/layout/components/TagsView Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ export default {
145
145
closeSelectedTag (view ) {
146
146
this .$store .dispatch (' tagsView/delView' , view).then (({ visitedViews }) => {
147
147
if (this .isActive (view)) {
148
- this .toLastView (visitedViews)
148
+ this .toLastView (visitedViews, view )
149
149
}
150
150
})
151
151
},
@@ -160,16 +160,22 @@ export default {
160
160
if (this .affixTags .some (tag => tag .path === view .path )) {
161
161
return
162
162
}
163
- this .toLastView (visitedViews)
163
+ this .toLastView (visitedViews, view )
164
164
})
165
165
},
166
- toLastView (visitedViews ) {
166
+ toLastView (visitedViews , view ) {
167
167
const latestView = visitedViews .slice (- 1 )[0 ]
168
168
if (latestView) {
169
169
this .$router .push (latestView)
170
170
} else {
171
- // You can set another route
172
- this .$router .push (' /' )
171
+ // now the default is to redirect to the home page if there is no tags-view,
172
+ // you can adjust it according to your needs.
173
+ if (view .name === ' Dashboard' ) {
174
+ // to reload home page
175
+ this .$router .replace ({ path: ' /redirect' + view .fullPath })
176
+ } else {
177
+ this .$router .push (' /' )
178
+ }
173
179
}
174
180
},
175
181
openMenu (tag , e ) {
You can’t perform that action at this time.
0 commit comments