fix: 修复问题

This commit is contained in:
wanchun 2022-06-06 19:18:17 +08:00
parent 00effaaa53
commit 5ecab4524d
2 changed files with 8 additions and 6 deletions

View File

@ -4,7 +4,7 @@
<input /> <input />
<FTabs v-model="activeKey"> <FTabs v-model="activeKey">
<FTabPane name="Tab 1" value="1"> <FTabPane name="Tab 1" value="1">
<MicroAppWithMemoHistory key="1" name="app1" url="/app1" a="1" /> <MicroAppWithMemoHistory key="1" style="background: red" name="app1" url="/app1" a="1" />
</FTabPane> </FTabPane>
<FTabPane name="Tab 2" value="2"> <FTabPane name="Tab 2" value="2">
<MicroAppWithMemoHistory key="2" name="app1" url="/app1/test" /> <MicroAppWithMemoHistory key="2" name="app1" url="/app1/test" />

View File

@ -65,11 +65,11 @@ export const MicroApp = defineComponent({
return {}; return {};
}); });
const propsConfigRef = computed(() => { const propsConfigRef = computed(() => {
return { return {
...propsFromConfigRef.value, ...propsFromConfigRef.value,
...props.props, ...props.props,
...attrs
}; };
}); });
@ -84,7 +84,7 @@ export const MicroApp = defineComponent({
name: `${name}_${props.entry || ''}`, name: `${name}_${props.entry || ''}`,
entry: entry, entry: entry,
container: containerRef.value, container: containerRef.value,
props: {...propsConfigRef.value} props: {...propsConfigRef.value, ...attrs}
}, },
{ {
...globalSettings, ...globalSettings,
@ -97,8 +97,10 @@ export const MicroApp = defineComponent({
(v1, v2) => concat(v1 ?? [], v2 ?? []) (v1, v2) => concat(v1 ?? [], v2 ?? [])
) )
); );
app.mount().catch((e)=>{ ['loadPromise', 'bootstrapPromise', 'mountPromise', 'unmountPromise'].forEach((key)=>{
console.log(e) app[key].catch((e)=>{
console.warn("[@fesjs/plugin-qiankun]", e)
})
}) })
microAppRef.value = app; microAppRef.value = app;
}; };
@ -136,7 +138,7 @@ export const MicroApp = defineComponent({
} }
// 返回 microApp.update 形成链式调用 // 返回 microApp.update 形成链式调用
return microApp.update({...propsConfigRef.value}); return microApp.update({...propsConfigRef.value, ...attrs});
} }
} }
); );