From 5ecab4524d52ae3159e081955905d1c6d2de95f7 Mon Sep 17 00:00:00 2001 From: wanchun <445436867@qq.com> Date: Mon, 6 Jun 2022 19:18:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../examples/main/src/pages/index.vue | 2 +- .../fes-plugin-qiankun/src/main/runtime/MicroApp.tpl | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/fes-plugin-qiankun/examples/main/src/pages/index.vue b/packages/fes-plugin-qiankun/examples/main/src/pages/index.vue index c5de2175..39dde730 100644 --- a/packages/fes-plugin-qiankun/examples/main/src/pages/index.vue +++ b/packages/fes-plugin-qiankun/examples/main/src/pages/index.vue @@ -4,7 +4,7 @@ - + diff --git a/packages/fes-plugin-qiankun/src/main/runtime/MicroApp.tpl b/packages/fes-plugin-qiankun/src/main/runtime/MicroApp.tpl index 6c479d86..21ff3346 100644 --- a/packages/fes-plugin-qiankun/src/main/runtime/MicroApp.tpl +++ b/packages/fes-plugin-qiankun/src/main/runtime/MicroApp.tpl @@ -65,11 +65,11 @@ export const MicroApp = defineComponent({ return {}; }); + const propsConfigRef = computed(() => { return { ...propsFromConfigRef.value, ...props.props, - ...attrs }; }); @@ -84,7 +84,7 @@ export const MicroApp = defineComponent({ name: `${name}_${props.entry || ''}`, entry: entry, container: containerRef.value, - props: {...propsConfigRef.value} + props: {...propsConfigRef.value, ...attrs} }, { ...globalSettings, @@ -97,8 +97,10 @@ export const MicroApp = defineComponent({ (v1, v2) => concat(v1 ?? [], v2 ?? []) ) ); - app.mount().catch((e)=>{ - console.log(e) + ['loadPromise', 'bootstrapPromise', 'mountPromise', 'unmountPromise'].forEach((key)=>{ + app[key].catch((e)=>{ + console.warn("[@fesjs/plugin-qiankun]", e) + }) }) microAppRef.value = app; }; @@ -136,7 +138,7 @@ export const MicroApp = defineComponent({ } // 返回 microApp.update 形成链式调用 - return microApp.update({...propsConfigRef.value}); + return microApp.update({...propsConfigRef.value, ...attrs}); } } );