}
)
})
+
+ it('keep params if not provided', () => {
+ assertRecordMatch(
+ { path: '/users/:id/m/:role', name: 'UserEdit', component },
+ {},
+ {
+ name: 'UserEdit',
+ path: '/users/ed/m/user',
+ params: { id: 'ed', role: 'user' },
+ },
+ {
+ path: '/users/ed/m/user',
+ name: 'UserEdit',
+ params: { id: 'ed', role: 'user' },
+ }
+ )
+ })
})
})
})
if (!matcher) throw new NoRouteMatchError(currentLocation, location)
+ let params = location.params ? location.params : currentLocation.params
+
return {
name: currentLocation.name,
- path: matcher.resolve(location.params),
- params: location.params || {},
+ path: matcher.resolve(params),
+ params,
}
}
}