Browse Source

test: 微应用通信测试通过

master
wangxiang 2 years ago
parent
commit
c1a525b2bf
  1. 6
      src/qiankun/state.ts

6
src/qiankun/state.ts

@ -26,12 +26,12 @@ export function getSubDefineProps() { @@ -26,12 +26,12 @@ export function getSubDefineProps() {
*
* @param state 穿
*/
export function initGlState(info = { test: 'demo' }) {
export function initGlState(info = { _state: 'foobar' }) {
const actions = initGlobalState(info);
// todo: 可根据自身的数据传输需求进行更改
actions.setGlobalState(info);
actions.onGlobalStateChange((newState, prev) => {
console.info(`newState:${newState}`, `prev:${prev}`);
for (const key in newState) console.info('newState:value', key);
debugger
console.log(newState, prev);
});
}

Loading…
Cancel
Save