src/main.js
@@ -46,6 +46,17 @@ // qiankun export async function bootstrap() {} export async function mount(props) { console.log(props, "子层获取的props"); props.onGlobalStateChange((state, prev) => { // state: 变更后的状态; prev 变更前的状态 console.log("子层change:",state, prev); if (state.bb) state.bb(123) }); props.setGlobalState({ aa: 2 }); render(props); } export async function unmount() { @@ -54,7 +65,7 @@ instance = null; } new Vue({ store, render: (h) => h(App) }).$mount("#app"); // new Vue({ // store, // render: (h) => h(App) // }).$mount("#app");