diff --git a/src/router/Router.ts b/src/router/Router.ts
index e08044ea..2bc64a52 100644
--- a/src/router/Router.ts
+++ b/src/router/Router.ts
@@ -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{
diff --git a/tests/router/directive.test.ts b/tests/router/directive.test.ts
index 7ac68d20..b8bf3274 100644
--- a/tests/router/directive.test.ts
+++ b/tests/router/directive.test.ts
@@ -43,12 +43,12 @@ describe("router directive t-routecomponent", () => {
];
const router = new Router(env,routes, {mode: 'history'})
- router.navigate({ route: "about" });
+ router.navigate({ name: "about" });
const app = new App(env);
await app.mount(fixture);
expect(fixture.innerHTML).toBe("
About
");
- router.navigate({ route: "users" });
+ router.navigate({ name: "users" });
await nextTick();
expect(fixture.innerHTML).toBe("Users
");
expect(env.qweb.templates.App.fn.toString()).toMatchSnapshot();
@@ -70,7 +70,7 @@ describe("router directive t-routecomponent", () => {
const routes = [{ name: "book", path: "/book/{{title}}", component: Book }];
const router = new Router(env,routes, {mode: 'history'})
- router.navigate({ route: "book", params: { title: "1984" } });
+ router.navigate({ name: "book", params: { title: "1984" } });
const app = new App(env);
await app.mount(fixture);
expect(fixture.innerHTML).toBe("Book 1984
");
@@ -97,7 +97,7 @@ describe("router directive t-routecomponent", () => {
const routes = [{ name: "book", path: "/book/{{title}}/{{val.number}}", component: Book }];
const router = new Router(env,routes, {mode: 'history'})
- router.navigate({ route: "book", params: { title: "1984", val: "123" } });
+ router.navigate({ name: "book", params: { title: "1984", val: "123" } });
const app = new App(env);
await app.mount(fixture);
expect(fixture.innerHTML).toBe("Book 1984|124
");