]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
refactor: prevent one function call
authorEduardo San Martin Morote <posva13@gmail.com>
Tue, 16 Apr 2019 16:57:31 +0000 (18:57 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Tue, 16 Apr 2019 16:57:31 +0000 (18:57 +0200)
src/router.ts

index d874252fe883a18b49fd03e0c0f5606213a5772b..342e5a26ac7a240f7856f8bc4cffdf93cb116dd4 100644 (file)
@@ -51,8 +51,9 @@ export class Router {
       // named or relative route
       // we need to resolve first
       location = this.matcher.resolve(to, this.currentRoute)
+      // intentionally drop current query and hash
       url = this.history.utils.normalizeLocation({
-        query: this.history.utils.normalizeQuery(to.query || {}),
+        query: to.query ? this.history.utils.normalizeQuery(to.query) : {},
         hash: to.hash,
         ...location,
       })