File tree 2 files changed +8
-4
lines changed
src/components/Breadcrumb
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ yarn-error.log*
18
18
# Editor directories and files
19
19
.idea
20
20
.vscode
21
+ .history
22
+ .ionide
21
23
* .suo
22
24
* .ntvs *
23
25
* .njsproj
Original file line number Diff line number Diff line change 22
22
</template >
23
23
24
24
<script lang="ts">
25
- import pathToRegexp from ' path-to-regexp'
25
+ import { compile } from ' path-to-regexp'
26
26
import { Component , Vue , Watch } from ' vue-property-decorator'
27
27
import { RouteRecord , Route } from ' vue-router'
28
28
@@ -67,17 +67,19 @@ export default class extends Vue {
67
67
private pathCompile(path : string ) {
68
68
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
69
69
const { params } = this .$route
70
- const toPath = pathToRegexp . compile (path )
70
+ const toPath = compile (path )
71
71
return toPath (params )
72
72
}
73
73
74
74
private handleLink(item : any ) {
75
+ // Throw Error "NavigationDuplicated"
76
+ // https://github.com/vuejs/vue-router/issues/2872
75
77
const { redirect, path } = item
76
78
if (redirect ) {
77
- this .$router .push (redirect )
79
+ this .$router .push (redirect ). catch ( _err => {})
78
80
return
79
81
}
80
- this .$router .push (this .pathCompile (path ))
82
+ this .$router .push (this .pathCompile (path )). catch ( _err => {})
81
83
}
82
84
}
83
85
</script >
You can’t perform that action at this time.
0 commit comments