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 {
145145 closeSelectedTag (view ) {
146146 this .$store .dispatch (' tagsView/delView' , view).then (({ visitedViews }) => {
147147 if (this .isActive (view)) {
148- this .toLastView (visitedViews)
148+ this .toLastView (visitedViews, view )
149149 }
150150 })
151151 },
@@ -160,16 +160,22 @@ export default {
160160 if (this .affixTags .some (tag => tag .path === view .path )) {
161161 return
162162 }
163- this .toLastView (visitedViews)
163+ this .toLastView (visitedViews, view )
164164 })
165165 },
166- toLastView (visitedViews ) {
166+ toLastView (visitedViews , view ) {
167167 const latestView = visitedViews .slice (- 1 )[0 ]
168168 if (latestView) {
169169 this .$router .push (latestView)
170170 } 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+ }
173179 }
174180 },
175181 openMenu (tag , e ) {
You can’t perform that action at this time.
0 commit comments