From 138614a57adaf11b46b86f95c70df00975903c7b Mon Sep 17 00:00:00 2001 From: roymondchen Date: Wed, 7 Dec 2022 19:59:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(cli):=20=E5=BC=82=E6=AD=A5=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E8=BF=94=E5=9B=9E=E5=BA=94=E8=AF=A5=E6=98=AF=E4=B8=AA?= =?UTF-8?q?=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/cli/src/utils/prepareEntryFile.ts | 2 +- runtime/vue3/page/main.ts | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/cli/src/utils/prepareEntryFile.ts b/packages/cli/src/utils/prepareEntryFile.ts index f88550d9..823c9690 100644 --- a/packages/cli/src/utils/prepareEntryFile.ts +++ b/packages/cli/src/utils/prepareEntryFile.ts @@ -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( diff --git a/runtime/vue3/page/main.ts b/runtime/vue3/page/main.ts index deb30939..02a85a38 100644 --- a/runtime/vue3/page/main.ts +++ b/runtime/vue3/page/main.ts @@ -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) => {