diff --git a/examples/sites/env/.env.innersaas b/examples/sites/env/.env.innersaas index 22303db3c..d585c92d4 100644 --- a/examples/sites/env/.env.innersaas +++ b/examples/sites/env/.env.innersaas @@ -5,4 +5,5 @@ VITE_TINY_THEME='saas' # 官网应用类型:pc / mobile / mobile-first VITE_APP_MODE='pc' VITE_APP_BUILD_BASE_URL=https://test-static-resource.obs.cn-north-7.ulanqab.huawei.com/tiny-vue-saas/${staticReleaseVersion}/ -VITE_PLAYGROUND_URL=/vue-saas-playground \ No newline at end of file +VITE_PLAYGROUND_URL=/vue-saas-playground +VITE_PLAYGROUND_VERIOSN=${playgroudVersion} \ No newline at end of file diff --git a/examples/sites/env/.env.saasopen b/examples/sites/env/.env.saasopen index 903f697e1..4179297ff 100644 --- a/examples/sites/env/.env.saasopen +++ b/examples/sites/env/.env.saasopen @@ -6,4 +6,5 @@ VITE_TINY_THEME='saas' VITE_APP_MODE='pc' VITE_APP_BUILD_BASE_URL=https://res.hc-cdn.com/tiny-vue-saas/${staticReleaseVersion}/ -VITE_PLAYGROUND_URL=/vue-saas-playground \ No newline at end of file +VITE_PLAYGROUND_URL=/vue-saas-playground +VITE_PLAYGROUND_VERIOSN=${playgroudVersion} \ No newline at end of file diff --git a/examples/sites/env/.env.saasprod b/examples/sites/env/.env.saasprod index 5fb116cab..2d25dabe0 100644 --- a/examples/sites/env/.env.saasprod +++ b/examples/sites/env/.env.saasprod @@ -6,4 +6,5 @@ VITE_TINY_THEME='saas' VITE_APP_MODE='pc' VITE_APP_BUILD_BASE_URL=https://res.hc-cdn.com/tiny-vue-saas/${staticReleaseVersion}/ -VITE_PLAYGROUND_URL=/vue-saas-playground \ No newline at end of file +VITE_PLAYGROUND_URL=/vue-saas-playground +VITE_PLAYGROUND_VERIOSN=${playgroudVersion} \ No newline at end of file diff --git a/examples/sites/playground/App.vue b/examples/sites/playground/App.vue index 7f7c8e8a0..972d08454 100644 --- a/examples/sites/playground/App.vue +++ b/examples/sites/playground/App.vue @@ -32,23 +32,8 @@ const versions = ['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) => { - if (isSaas) { - return import.meta.env.VITE_APP_BUILD_BASE_URL - } - return `${cdnHost}/@opentiny/vue@${version}/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 useVersion = import.meta.env.VITE_PLAYGROUND_VERIOSN || version + return `${cdnHost}/@opentiny/vue@${useVersion}/runtime/` } const createImportMap = (version) => { @@ -67,10 +52,9 @@ const createImportMap = (version) => { } if (isSaas) { imports['@opentiny/vue-icon'] = `${getRuntime(version)}tiny-vue-icon-saas.mjs` - imports[`@opentiny/vue-design-saas`] = `${getRuntime(version)}tiny-vue-design-saas.js` } return { - imports: changeImportSuffix(imports, version) + imports } } @@ -78,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'