From 5813c77cc0324d63aae89a2f867ff5d4338a7eef Mon Sep 17 00:00:00 2001 From: gimmyhehe <975402925@qq.com> Date: Thu, 7 Mar 2024 14:49:43 +0800 Subject: [PATCH] docs(sites): add 3.14 version playground (#1470) --- examples/sites/playground/App.vue | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/examples/sites/playground/App.vue b/examples/sites/playground/App.vue index 458beeeb7..94639482f 100644 --- a/examples/sites/playground/App.vue +++ b/examples/sites/playground/App.vue @@ -17,7 +17,7 @@ import logoUrl from './assets/opentiny-logo.svg?url' import GitHub from './icons/Github.vue' import Share from './icons/Share.vue' -const VERSION = 'tiny-vue-version-3.13' +const VERSION = 'tiny-vue-version-3.14' const LAYOUT = 'playground-layout' const LAYOUT_REVERSE = 'playground-layout-reverse' @@ -28,7 +28,7 @@ const isMobileFirst = tinyMode === 'mobile-first' const isSaas = tinyTheme === 'saas' const isPreview = searchObj.get('openMode') === 'preview' // 是否多端弹窗预览 -const versions = ['3.13', '3.12', '3.11', '3.10', '3.9', '3.8'] +const versions = ['3.14', '3.13', '3.12', '3.11', '3.10', '3.9', '3.8'] const latestVersion = isPreview ? versions[0] : localStorage.getItem(VERSION) || versions[0] const cdnHost = localStorage.getItem('setting-cdn') const getRuntime = (version) => { @@ -36,19 +36,6 @@ const getRuntime = (version) => { return `${cdnHost}/@opentiny/vue@${useVersion}/runtime/` } -const changeImportSuffix = (imports, verison) => { - const newImports = {} - Object.keys(imports).forEach((key) => { - const url = imports[key] - if (url.startsWith(getRuntime(verison))) { - newImports[key] = url.replace('.mjs', '.js') - } else { - newImports[key] = url - } - }) - return newImports -} - const createImportMap = (version) => { const imports = { '@opentiny/vue': `${getRuntime(version)}tiny-vue.mjs`, @@ -67,7 +54,7 @@ const createImportMap = (version) => { imports['@opentiny/vue-icon'] = `${getRuntime(version)}tiny-vue-icon-saas.mjs` } return { - imports: changeImportSuffix(imports, version) + imports } } @@ -75,9 +62,6 @@ const getTinyTheme = (version) => { if (isMobileFirst) { return `${getRuntime(version)}tailwind.css` } - if (isSaas) { - return `${getRuntime(version)}index.css` - } let theme = tinyTheme if (!['smb', 'default', 'aurora', 'saas'].includes(theme)) { theme = 'default'