File tree Expand file tree Collapse file tree 2 files changed +3
-20
lines changed Expand file tree Collapse file tree 2 files changed +3
-20
lines changed Original file line number Diff line number Diff line change @@ -135,14 +135,9 @@ export function getHash (): string {
135135
136136function getUrl ( path ) {
137137 const href = window . location . href
138- const hashPos = href . indexOf ( '#' )
139- let base = hashPos > - 1 ? href . slice ( 0 , hashPos ) : href
140-
141- const searchPos = base . indexOf ( '?' )
142- const query = searchPos > - 1 ? base . slice ( searchPos ) : ''
143- base = query ? base . slice ( 0 , searchPos ) : base
144-
145- return `${ base } #${ path + query } `
138+ const i = href . indexOf ( '#' )
139+ const base = i >= 0 ? href . slice ( 0 , i ) : href
140+ return `${ base } #${ path } `
146141}
147142
148143function pushHash ( path ) {
Original file line number Diff line number Diff line change @@ -57,18 +57,6 @@ module.exports = {
5757 . waitForElementVisible ( '#app' , 1000 )
5858 . assert . containsText ( '.view' , 'unicode: ñ' )
5959 . assert . containsText ( '#query-t' , '%' )
60-
61- // correctly placing query
62- // https://github.com/vuejs/vue-router/issues/2125
63- . url ( 'http://localhost:8080/hash-mode/?key=foo' )
64- . waitForElementVisible ( '#app' , 1000 )
65- . assert . urlEquals ( 'http://localhost:8080/hash-mode/#/?key=foo' )
66- . url ( 'http://localhost:8080/hash-mode?key=foo' )
67- . waitForElementVisible ( '#app' , 1000 )
68- . assert . urlEquals ( 'http://localhost:8080/hash-mode/#/?key=foo' )
69- . url ( 'http://localhost:8080/hash-mode?key=foo#other' )
70- . waitForElementVisible ( '#app' , 1000 )
71- . assert . urlEquals ( 'http://localhost:8080/hash-mode/#/other?key=foo' )
7260 . end ( )
7361 }
7462}
You can’t perform that action at this time.
0 commit comments