[FIX] router: preserve pathname in hash mode

closes #397
This commit is contained in:
Géry Debongnie
2019-10-27 21:11:11 +01:00
committed by Aaron Bohy
parent 5911c8e3f6
commit 2aa705f5c8
2 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -148,7 +148,7 @@ export class Router {
//--------------------------------------------------------------------------
private setUrlFromPath(path: string) {
const separator = this.mode === "hash" ? "/" : "";
const separator = this.mode === "hash" ? location.pathname : "";
const url = location.origin + separator + path;
if (url !== window.location.href) {
window.history.pushState({}, path, url);