Skip to content

Commit

Permalink
Fix(tagsview): fix tagsview close tags throw 404 page error.
Browse files Browse the repository at this point in the history
  • Loading branch information
Armour committed Apr 3, 2020
1 parent ad884f8 commit ae1d070
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 28 deletions.
16 changes: 5 additions & 11 deletions mock/role/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,17 +596,11 @@ export const asyncRoutes = [
]
},
{
path: 'external-link',
component: 'Layout',
children: [
{
path: 'https://github.com/Armour/vue-typescript-admin-template',
meta: {
title: 'externalLink',
icon: 'link'
}
}
]
path: 'https://github.com/Armour/vue-typescript-admin-template',
meta: {
title: 'externalLink',
icon: 'link'
}
},
{
path: '*',
Expand Down
2 changes: 1 addition & 1 deletion src/components/HeaderSearch/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export default class extends Vue {
private querySearch(query: string) {
if (query !== '') {
if (this.fuse) {
this.options = this.fuse.search(query) as any
this.options = this.fuse.search(query).map((result) => result.item)
}
} else {
this.options = []
Expand Down
8 changes: 4 additions & 4 deletions src/layout/components/TagsView/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ export default class extends Vue {
}
private closeOthersTags() {
if (this.selectedTag.title !== undefined) {
this.$router.push(this.selectedTag.title)
if (this.selectedTag.fullPath !== undefined) {
this.$router.push(this.selectedTag.fullPath)
}
TagsViewModule.delOthersViews(this.selectedTag)
this.moveToCurrentTag()
Expand All @@ -199,8 +199,8 @@ export default class extends Vue {
private toLastView(visitedViews: ITagView[], view: ITagView) {
const latestView = visitedViews.slice(-1)[0]
if (latestView !== undefined && latestView.title !== undefined) {
this.$router.push(latestView.title)
if (latestView !== undefined && latestView.fullPath !== undefined) {
this.$router.push(latestView.fullPath)
} else {
// Default redirect to the home page if there is no tags-view, adjust it if you want
if (view.name === 'Dashboard') {
Expand Down
16 changes: 5 additions & 11 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,17 +426,11 @@ export const asyncRoutes: RouteConfig[] = [
]
},
{
path: 'external-link',
component: Layout,
children: [
{
path: 'https://github.com/Armour/vue-typescript-admin-template',
meta: {
title: 'externalLink',
icon: 'link'
}
}
]
path: 'https://github.com/Armour/vue-typescript-admin-template',
meta: {
title: 'externalLink',
icon: 'link'
}
},
{
path: '*',
Expand Down
2 changes: 1 addition & 1 deletion src/views/i18n-demo/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export default class extends Vue {

<style lang="scss" scoped>
.box-card {
width: 600px;
width: 700px;
max-width: 100%;
margin: 20px auto;
}
Expand Down

0 comments on commit ae1d070

Please sign in to comment.