Skip to content

Commit c2449f5

Browse files
authored
docs: keep current path when switching versions (vueComponent#3927)
1 parent 9670992 commit c2449f5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

antdv-demo/components/header.vue

+4-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ export default {
6464
this.value = val;
6565
},
6666
closeTopBanner() {},
67+
changeVersion() {
68+
location.href = `https://2x.antdv.com${this.$route.fullPath}`;
69+
},
6770
},
6871
render() {
6972
const name = this.name;
@@ -179,7 +182,7 @@ export default {
179182
</a-button>
180183
<a-select size="small" defaultValue={packageInfo.version} class="version">
181184
<a-select-option value={packageInfo.version}>{packageInfo.version}</a-select-option>
182-
<a-select-option value="2.x" onClick={() => (location.href = 'https://2x.antdv.com')}>
185+
<a-select-option value="2.x" onClick={this.changeVersion}>
183186
2.x
184187
</a-select-option>
185188
</a-select>

0 commit comments

Comments
 (0)