mirror of
https://gitee.com/WeBank/fes.js.git
synced 2024-11-29 18:28:09 +08:00
fix: 修复清空父应用状态,子应用状态未清空问题 (#251)
This commit is contained in:
parent
314dc2133b
commit
df36be4671
@ -3,9 +3,12 @@ import { cloneDeep } from 'lodash-es'
|
||||
let initState = reactive({});
|
||||
const setModelState = (props) => {
|
||||
// 使用深拷贝去掉主应用数据和子应用数据的引用关系,避免出现副作用。
|
||||
Object.keys(initState).forEach(p=>{
|
||||
delete initState[p]
|
||||
})
|
||||
Object.assign(initState, cloneDeep(props))
|
||||
};
|
||||
|
||||
export default () => initState;
|
||||
|
||||
export { setModelState };
|
||||
export { setModelState };
|
||||
|
Loading…
Reference in New Issue
Block a user