Skip to content

Commit

Permalink
fix(VersionSelect): remove typescript select
Browse files Browse the repository at this point in the history
🤔I don't think developer need to switch typescript version in vant playground.
  • Loading branch information
nemo-shen committed Jan 6, 2024
1 parent db3f315 commit 23a8918
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 23 deletions.
10 changes: 5 additions & 5 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ export {}

declare module 'vue' {
export interface GlobalComponents {
Console: (typeof import('./src/components/Console.vue'))['default'];
Header: (typeof import('./src/components/Header.vue'))['default'];
Message: (typeof import('./src/components/Message.vue'))['default'];
VanIcon: (typeof import('vant/es'))['Icon'];
VersionSelect: (typeof import('./src/components/VersionSelect.vue'))['default'];
Console: typeof import('./src/components/Console.vue')['default']
Header: typeof import('./src/components/Header.vue')['default']
Message: typeof import('./src/components/Message.vue')['default']
VanIcon: typeof import('vant/es')['Icon']
VersionSelect: typeof import('./src/components/VersionSelect.vue')['default']
}
}
19 changes: 1 addition & 18 deletions src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ const onChangeVersion = (key: keyof typeof versions, version: string) => {
store.setImportMap(importMap);
break;
case 'typescript':
store.setTypeScriptVersion(version);
break;
}
};
Expand All @@ -64,19 +61,10 @@ const getSupportedVueVersions = () => {
);
};
const getSupportedTSVersions = () => {
const versions = getVersions('typescript');
return computed(() =>
versions.value.filter(
(version) => !version.includes('dev') && !version.includes('insiders'),
),
);
};
const getVersionActive = (pkg: 'vue') => {
switch (pkg) {
case 'vue':
return store.getVueVersion()
return store.getVueVersion();
}
};
const versions = reactive<Record<string, Version>>({
Expand All @@ -90,11 +78,6 @@ const versions = reactive<Record<string, Version>>({
published: getSupportedVueVersions(),
active: getVersionActive('vue'),
},
typescript: {
text: 'TypeScript',
published: getSupportedTSVersions(),
active: '',
},
});
const dark = useDark();
Expand Down

0 comments on commit 23a8918

Please sign in to comment.