Skip to content

Commit 6ab3769

Browse files
fix(vuejs#2725): remove duplicated decodeURIComponent
1 parent 2730df8 commit 6ab3769

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

examples/basic/app.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const Home = { template: '<div>home</div>' }
3535
const Foo = { template: '<div>foo</div>' }
3636
const Bar = { template: '<div>bar</div>' }
3737
const Unicode = { template: '<div>unicode</div>' }
38-
const Query = { template: '<div>query: {{ $route.params.q }}</div>' }
38+
const Query = { template: '<div>query: "{{ $route.params.q }}"</div>' }
3939

4040
// 3. Create the router
4141
const router = new VueRouter({
@@ -75,7 +75,7 @@ const vueInstance = new Vue({
7575
</li>
7676
</router-link>
7777
<li><router-link to="/foo" replace>/foo (replace)</router-link></li>
78-
<li><router-link to="/query/A%25">/query/A%</router-link></li>
78+
<li><router-link to="/query/A%">/query/A%</router-link></li>
7979
</ul>
8080
<button id="navigate-btn" @click="navigateAndIncrement">On Success</button>
8181
<pre id="counter">{{ n }}</pre>

examples/hash-mode/app.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const Home = { template: '<div>home</div>' }
3535
const Foo = { template: '<div>foo</div>' }
3636
const Bar = { template: '<div>bar</div>' }
3737
const Unicode = { template: '<div>unicode: {{ $route.params.unicode }}</div>' }
38-
const Query = { template: '<div>query: {{ $route.params.q }}</div>' }
38+
const Query = { template: '<div>query: "{{ $route.params.q }}"</div>' }
3939

4040
// 3. Create the router
4141
const router = new VueRouter({
@@ -68,7 +68,7 @@ const vueInstance = new Vue({
6868
<li><router-link to="/é/ñ">/é/ñ</router-link></li>
6969
<li><router-link to="/é/ñ?t=%25ñ">/é/ñ?t=%ñ</router-link></li>
7070
<li><router-link to="/é/ñ#é">/é/ñ#é</router-link></li>
71-
<li><router-link to="/query/A%25">/query/A%</router-link></li>
71+
<li><router-link to="/query/A%">/query/A%</router-link></li>
7272
</ul>
7373
<pre id="query-t">{{ $route.query.t }}</pre>
7474
<pre id="hash">{{ $route.hash }}</pre>

test/e2e/specs/basic.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = {
2020
.assert.attributeContains('li:nth-child(6) a', 'href', '/basic/%C3%A9?t=%25%C3%B1')
2121
.assert.attributeContains('li:nth-child(7) a', 'href', '/basic/%C3%A9#%25%C3%B1')
2222
.assert.attributeContains('li:nth-child(8) a', 'href', '/basic/foo')
23-
.assert.attributeContains('li:nth-child(10) a', 'href', '/basic/query/A%25')
23+
.assert.attributeContains('li:nth-child(10) a', 'href', '/basic/query/A%')
2424
.assert.containsText('.view', 'home')
2525

2626
.click('li:nth-child(2) a')
@@ -75,10 +75,10 @@ module.exports = {
7575
// https://github.com/vuejs/vue-router/issues/2725
7676
.url('http://localhost:8080/basic/query/A%25')
7777
.waitForElementVisible('#app', 1000)
78-
.assert.containsText('.view', 'query: A%')
78+
.assert.containsText('.view', 'query: "A%"')
7979
.click('li:nth-child(10) a')
8080
.assert.urlEquals('http://localhost:8080/basic/query/A%25')
81-
.assert.containsText('.view', 'query: A%')
81+
.assert.containsText('.view', 'query: "A%"')
8282

8383
// Listener cleanup
8484
.assert.containsText('#popstate-count', '1 popstate listeners')

test/e2e/specs/hash-mode.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = {
1717
.assert.attributeContains('li:nth-child(5) a', 'href', '/hash-mode/#/%C3%A9')
1818
.assert.attributeContains('li:nth-child(6) a', 'href', '/hash-mode/#/%C3%A9/%C3%B1')
1919
.assert.attributeContains('li:nth-child(7) a', 'href', '/hash-mode/#/%C3%A9/%C3%B1?t=%25%C3%B1')
20-
.assert.attributeContains('li:nth-child(9) a', 'href', '/hash-mode/#/query/A%25')
20+
.assert.attributeContains('li:nth-child(9) a', 'href', '/hash-mode/#/query/A%')
2121
.assert.containsText('.view', 'home')
2222

2323
.click('li:nth-child(2) a')
@@ -63,10 +63,10 @@ module.exports = {
6363
// https://github.com/vuejs/vue-router/issues/2725
6464
.url('http://localhost:8080/hash-mode/#/query/A%25')
6565
.waitForElementVisible('#app', 1000)
66-
.assert.containsText('.view', 'query: A%')
66+
.assert.containsText('.view', 'query: "A%"')
6767
.click('li:nth-child(9) a')
6868
.assert.urlEquals('http://localhost:8080/hash-mode/#/query/A%25')
69-
.assert.containsText('.view', 'query: A%')
69+
.assert.containsText('.view', 'query: "A%"')
7070

7171
// Listener cleanup
7272
.assert.containsText('#popstate-count', '1 popstate listeners')

0 commit comments

Comments
 (0)