docs: version menu (#6390)

pull/6439/head
Cherry7 2023-03-27 08:16:03 +08:00 committed by GitHub
parent 9dbe035efe
commit ae27d430e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -12,6 +12,7 @@
:default-value="antdVersion"
>
<a-select-option :value="antdVersion">{{ antdVersion }}</a-select-option>
<a-select-option value="3.x" @click="changeVersion('3x')">3.x</a-select-option>
<a-select-option value="2.x" @click="changeVersion('2x')">
2.x (Not Recommended)
</a-select-option>
@ -69,7 +70,12 @@ export default defineComponent({
);
};
const changeVersion = v => {
const changeVersion = (v: string) => {
if (v === '3x') {
// TODO: 3.x site
location.href = `https://antdv.com${route.fullPath}`;
return;
}
location.href = `https://${v}.antdv.com${route.fullPath}`;
};
return {