File tree 5 files changed +4
-16
lines changed 5 files changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ const vueInstance = new Vue({
75
75
</li>
76
76
</router-link>
77
77
<li><router-link to="/foo" replace>/foo (replace)</router-link></li>
78
- <li><router-link to="/query/A%">/query/A%</router-link></li>
78
+ <li><router-link to="/query/A%25 ">/query/A%</router-link></li>
79
79
</ul>
80
80
<button id="navigate-btn" @click="navigateAndIncrement">On Success</button>
81
81
<pre id="counter">{{ n }}</pre>
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ const vueInstance = new Vue({
68
68
<li><router-link to="/é/ñ">/é/ñ</router-link></li>
69
69
<li><router-link to="/é/ñ?t=%25ñ">/é/ñ?t=%ñ</router-link></li>
70
70
<li><router-link to="/é/ñ#é">/é/ñ#é</router-link></li>
71
- <li><router-link to="/query/A%">/query/A%</router-link></li>
71
+ <li><router-link to="/query/A%25 ">/query/A%</router-link></li>
72
72
</ul>
73
73
<pre id="query-t">{{ $route.query.t }}</pre>
74
74
<pre id="hash">{{ $route.hash }}</pre>
Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ function matchRoute (
175
175
path : string ,
176
176
params : Object
177
177
) : boolean {
178
- const m = path . match ( regex )
178
+ const m = decodeURI ( path ) . match ( regex )
179
179
180
180
if ( ! m ) {
181
181
return false
Original file line number Diff line number Diff line change @@ -124,18 +124,6 @@ export function getHash (): string {
124
124
if ( index < 0 ) return ''
125
125
126
126
href = href . slice ( index + 1 )
127
- // decode the hash but not the search or hash
128
- // as search(query) is already decoded
129
- // https://github.com/vuejs/vue-router/issues/2708
130
- const searchIndex = href . indexOf ( '?' )
131
- if ( searchIndex < 0 ) {
132
- const hashIndex = href . indexOf ( '#' )
133
- if ( hashIndex > - 1 ) {
134
- href = decodeURI ( href . slice ( 0 , hashIndex ) ) + href . slice ( hashIndex )
135
- } else href = decodeURI ( href )
136
- } else {
137
- href = decodeURI ( href . slice ( 0 , searchIndex ) ) + href . slice ( searchIndex )
138
- }
139
127
140
128
return href
141
129
}
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ export class HTML5History extends History {
86
86
}
87
87
88
88
export function getLocation ( base : string ) : string {
89
- let path = decodeURI ( window . location . pathname )
89
+ let path = window . location . pathname
90
90
if ( base && path . toLowerCase ( ) . indexOf ( base . toLowerCase ( ) ) === 0 ) {
91
91
path = path . slice ( base . length )
92
92
}
You can’t perform that action at this time.
0 commit comments