mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
fix: plugin-qiankun修复主应用更新props不触发update
This commit is contained in:
parent
baff9073c4
commit
c0cc29da44
@ -64,13 +64,11 @@ export const MicroApp = defineComponent({
|
||||
return {};
|
||||
});
|
||||
|
||||
const propsFromParams = attrs;
|
||||
|
||||
const propsConfigRef = computed(() => {
|
||||
return {
|
||||
...propsFromConfigRef.value,
|
||||
...props.props,
|
||||
...propsFromParams
|
||||
...attrs
|
||||
};
|
||||
});
|
||||
|
||||
@ -85,7 +83,7 @@ export const MicroApp = defineComponent({
|
||||
name: `${name}_${Date.now()}`,
|
||||
entry: entry,
|
||||
container: containerRef.value,
|
||||
props: propsConfigRef.value
|
||||
props: {...propsConfigRef.value}
|
||||
},
|
||||
{
|
||||
...globalSettings,
|
||||
@ -107,7 +105,7 @@ export const MicroApp = defineComponent({
|
||||
if (!updatingPromiseRef.value) {
|
||||
// 初始化 updatingPromiseRef 为 microApp.mountPromise,从而确保后续更新是在应用 mount 完成之后
|
||||
updatingPromiseRef.value = microApp.mountPromise;
|
||||
} else {
|
||||
}
|
||||
// 确保 microApp.update 调用是跟组件状态变更顺序一致的,且后一个微应用更新必须等待前一个更新完成
|
||||
updatingPromiseRef.value = updatingPromiseRef.value.then(
|
||||
() => {
|
||||
@ -133,12 +131,11 @@ export const MicroApp = defineComponent({
|
||||
}
|
||||
|
||||
// 返回 microApp.update 形成链式调用
|
||||
return microApp.update(propsConfigRef.value);
|
||||
return microApp.update({...propsConfigRef.value});
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user