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 />
<FTabs v-model="activeKey">
<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 name="Tab 2" value="2">
<MicroAppWithMemoHistory key="2" name="app1" url="/app1/test" />

View File

@ -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});
}
}
);