File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export default {
2727 const router = this . $router
2828 const current = this . $route
2929 const to = normalizeLocation ( this . to , current , this . append )
30- const resolved = router . match ( to )
30+ const resolved = router . match ( to , current )
3131 const fullPath = resolved . redirectedFrom || resolved . fullPath
3232 const base = router . history . base
3333 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 {
3131
3232 if ( name ) {
3333 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+
3447 if ( record ) {
3548 location . path = fillParams ( record . path , location . params , `named route "${ name } "` )
3649 return _createRoute ( record , location , redirectedFrom )
You can’t perform that action at this time.
0 commit comments