File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export default {
27
27
const router = this . $router
28
28
const current = this . $route
29
29
const to = normalizeLocation ( this . to , current , this . append )
30
- const resolved = router . match ( to )
30
+ const resolved = router . match ( to , current )
31
31
const fullPath = resolved . redirectedFrom || resolved . fullPath
32
32
const base = router . history . base
33
33
const href = createHref ( base , fullPath , router . mode )
Original file line number Diff line number Diff line change @@ -31,6 +31,19 @@ export function createMatcher (routes: Array<RouteConfig>): Matcher {
31
31
32
32
if ( name ) {
33
33
const record = nameMap [ name ]
34
+
35
+ if ( typeof location . params !== 'object' ) {
36
+ location . params = { }
37
+ }
38
+
39
+ if ( currentRoute && typeof currentRoute . params === 'object' ) {
40
+ for ( const key in currentRoute . params ) {
41
+ if ( ! ( key in location . params ) ) {
42
+ location . params [ key ] = currentRoute . params [ key ]
43
+ }
44
+ }
45
+ }
46
+
34
47
if ( record ) {
35
48
location . path = fillParams ( record . path , location . params , `named route "${ name } "` )
36
49
return _createRoute ( record , location , redirectedFrom )
You can’t perform that action at this time.
0 commit comments