Skip to content

Commit

Permalink
fix: initial url path for non ascii urls (#2375)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aldarund authored and posva committed Sep 4, 2018
1 parent 1d2cc65 commit c3b0a33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/history/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class HTML5History extends History {
}

export function getLocation (base: string): string {
let path = window.location.pathname
let path = decodeURI(window.location.pathname)
if (base && path.indexOf(base) === 0) {
path = path.slice(base.length)
}
Expand Down

0 comments on commit c3b0a33

Please sign in to comment.