[REF] router: change Destination shape

This commit is contained in:
Géry Debongnie
2019-07-25 23:06:15 +02:00
parent cd0762b436
commit bb46346767
2 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -18,8 +18,8 @@ export interface RouterEnv extends Env {
}
export interface Destination {
to?: string;
route?: string;
path?: string;
name?: string;
params?: RouteParams;
}
@@ -74,7 +74,7 @@ export class Router {
}
destToUrl(dest: Destination): string {
return dest.to || this.routeToURL(this.routes[dest.route!].path, dest.params!);
return dest.path || this.routeToURL(this.routes[dest.name!].path, dest.params!);
}
get currentRouteName(): string | null{