fix(element-plus-adapter): 构建时将vue源码构建入目标代码中,导致页面存在多个版本vue

This commit is contained in:
roymondchen 2025-11-24 20:27:53 +08:00
parent 849b4dc319
commit bb7ec0aa1b
3 changed files with 10 additions and 6 deletions

View File

@ -37,6 +37,7 @@
"peerDependencies": {
"@tmagic/design": "workspace:*",
"element-plus": ">=2.9.0",
"vue": "catalog:",
"typescript": "catalog:"
},
"peerDependenciesMeta": {

View File

@ -50,19 +50,19 @@ globalThis.MonacoEnvironment = {
},
};
const adpter = sessionStorage.getItem('tmagic-playground-ui-adapter') || 'element-plus';
const adapter = sessionStorage.getItem('tmagic-playground-ui-adapter') || 'element-plus';
let adpterModule;
let adapterModule;
if (adpter === 'tdesign-vue-next') {
if (adapter === 'tdesign-vue-next') {
import('tdesign-vue-next/es/style/index.css');
adpterModule = import('@tmagic/tdesign-vue-next-adapter');
adapterModule = import('@tmagic/tdesign-vue-next-adapter');
} else {
import('element-plus/dist/index.css');
adpterModule = import('@tmagic/element-plus-adapter');
adapterModule = import('@tmagic/element-plus-adapter');
}
adpterModule.then((module: any) => {
adapterModule.then((module: any) => {
const app = createApp(App);
app.use(router);
app.use(editorPlugin, module.default);

3
pnpm-lock.yaml generated
View File

@ -390,6 +390,9 @@ importers:
typescript:
specifier: 'catalog:'
version: 5.9.3
vue:
specifier: 'catalog:'
version: 3.5.24(typescript@5.9.3)
packages/form:
dependencies: