From 23a891843d6d365c67cb53ae6743e1587c1fca62 Mon Sep 17 00:00:00 2001 From: nemo shen Date: Sat, 6 Jan 2024 20:01:50 +0800 Subject: [PATCH] fix(VersionSelect): remove typescript select MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤔I don't think developer need to switch typescript version in vant playground. --- components.d.ts | 10 +++++----- src/components/Header.vue | 19 +------------------ 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/components.d.ts b/components.d.ts index 98cc9cd..c00f62d 100644 --- a/components.d.ts +++ b/components.d.ts @@ -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'] } } diff --git a/src/components/Header.vue b/src/components/Header.vue index 2c65dc5..8ba775c 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -40,9 +40,6 @@ const onChangeVersion = (key: keyof typeof versions, version: string) => { store.setImportMap(importMap); break; - case 'typescript': - store.setTypeScriptVersion(version); - break; } }; @@ -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>({ @@ -90,11 +78,6 @@ const versions = reactive>({ published: getSupportedVueVersions(), active: getVersionActive('vue'), }, - typescript: { - text: 'TypeScript', - published: getSupportedTSVersions(), - active: '', - }, }); const dark = useDark();