From: Eduardo San Martin Morote Date: Thu, 2 May 2019 08:41:58 +0000 (+0200) Subject: chore: comments X-Git-Tag: v4.0.0-alpha.0~417 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd96eb1baeb4011e4bef405c8bf8491f497994c8;p=thirdparty%2Fvuejs%2Frouter.git chore: comments --- diff --git a/src/router.ts b/src/router.ts index 101cffd4..4ba45d1d 100644 --- a/src/router.ts +++ b/src/router.ts @@ -67,11 +67,14 @@ export class Router { }) } - // TODO: refactor in a function, some kind of queue const toLocation: RouteLocationNormalized = { ...url, ...location } + // trigger all guards, throw if navigation is rejected await this.navigate(toLocation, this.currentRoute) + + // change URL if (to.replace === true) this.history.replace(url) else this.history.push(url) + const from = this.currentRoute this.currentRoute = toLocation