mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-12-12 03:02:50 +00:00
fix(element-plus-adapter): 构建时将vue源码构建入目标代码中,导致页面存在多个版本vue
This commit is contained in:
parent
849b4dc319
commit
bb7ec0aa1b
@ -37,6 +37,7 @@
|
|||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tmagic/design": "workspace:*",
|
"@tmagic/design": "workspace:*",
|
||||||
"element-plus": ">=2.9.0",
|
"element-plus": ">=2.9.0",
|
||||||
|
"vue": "catalog:",
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
},
|
},
|
||||||
"peerDependenciesMeta": {
|
"peerDependenciesMeta": {
|
||||||
|
|||||||
@ -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');
|
import('tdesign-vue-next/es/style/index.css');
|
||||||
adpterModule = import('@tmagic/tdesign-vue-next-adapter');
|
adapterModule = import('@tmagic/tdesign-vue-next-adapter');
|
||||||
} else {
|
} else {
|
||||||
import('element-plus/dist/index.css');
|
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);
|
const app = createApp(App);
|
||||||
app.use(router);
|
app.use(router);
|
||||||
app.use(editorPlugin, module.default);
|
app.use(editorPlugin, module.default);
|
||||||
|
|||||||
3
pnpm-lock.yaml
generated
3
pnpm-lock.yaml
generated
@ -390,6 +390,9 @@ importers:
|
|||||||
typescript:
|
typescript:
|
||||||
specifier: 'catalog:'
|
specifier: 'catalog:'
|
||||||
version: 5.9.3
|
version: 5.9.3
|
||||||
|
vue:
|
||||||
|
specifier: 'catalog:'
|
||||||
|
version: 3.5.24(typescript@5.9.3)
|
||||||
|
|
||||||
packages/form:
|
packages/form:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user