mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
fix(cli): 异步组件返回应该是个函数
This commit is contained in:
parent
ba20eb8cf1
commit
138614a57a
@ -41,7 +41,7 @@ const generateContent = (
|
||||
const name = makeCamelCase(key);
|
||||
if (dynamicImport) {
|
||||
list.push(
|
||||
`'${key}': import('${packagePath}${packagePath.endsWith(componentFileAffix) ? '' : componentFileAffix}')`,
|
||||
`'${key}': () => import('${packagePath}${packagePath.endsWith(componentFileAffix) ? '' : componentFileAffix}')`,
|
||||
);
|
||||
} else {
|
||||
importDeclarations.push(
|
||||
|
@ -33,10 +33,7 @@ const magicApp = createApp(AppComponent);
|
||||
magicApp.use(request);
|
||||
|
||||
Object.entries(components).forEach(([type, component]: [string, any]) => {
|
||||
magicApp.component(
|
||||
`magic-ui-${type}`,
|
||||
defineAsyncComponent(() => component),
|
||||
);
|
||||
magicApp.component(`magic-ui-${type}`, defineAsyncComponent(component));
|
||||
});
|
||||
|
||||
Object.values(plugins).forEach((plugin: any) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user