Skip to content

Commit c3b0a33

Browse files
aldarundposva
authored andcommitted
fix: initial url path for non ascii urls (#2375)
Here is demo of issue https://codesandbox.io/s/m2xnyj5zx If click links withing app - active class applies fine for both links If load page on /hello - active class applies to hello link fine If load page on /тест - active class applies not applied to /тест link and the component not loaded The problem is because on initial load vue-router use window.location.pathname for path, which is uri encoded, so it wont match routes because they are not uri encoded.
1 parent 1d2cc65 commit c3b0a33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/history/html5.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class HTML5History extends History {
7272
}
7373

7474
export function getLocation (base: string): string {
75-
let path = window.location.pathname
75+
let path = decodeURI(window.location.pathname)
7676
if (base && path.indexOf(base) === 0) {
7777
path = path.slice(base.length)
7878
}

0 commit comments

Comments
 (0)