From be612822a649a81680f364f15d3e8ca3df4c4bc8 Mon Sep 17 00:00:00 2001 From: Kuitos Date: Tue, 3 Mar 2020 21:38:00 +0800 Subject: [PATCH] =?UTF-8?q?:loud=5Fsound:=20=E5=A2=9E=E5=8A=A0=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/app2/app.js | 6 +++--- src/master/runtimePlugin.ts | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/app2/app.js b/examples/app2/app.js index 1d7c079..037346b 100644 --- a/examples/app2/app.js +++ b/examples/app2/app.js @@ -1,14 +1,14 @@ export const qiankun = { // 应用加载之前 async bootstrap(props) { - console.log('app1 bootstrap', props); + console.log('app2 bootstrap', props); }, // 应用 render 之前触发 async mount(props) { - console.log('app1 mount', props); + console.log('app2 mount', props); }, // 应用卸载之后触发 async unmount(props) { - console.log('app1 unmount', props); + console.log('app2 unmount', props); }, }; diff --git a/src/master/runtimePlugin.ts b/src/master/runtimePlugin.ts index b2a27fe..ac1b6fe 100644 --- a/src/master/runtimePlugin.ts +++ b/src/master/runtimePlugin.ts @@ -72,7 +72,7 @@ export async function render(oldRender: typeof noop) { isAppActive(location, history, { base, setMatchedBase: (v: string) => (matchedBase = v) }), render: ({ appContent, loading }) => { if (process.env.NODE_ENV === 'development') { - console.info(`app ${name} loading ${loading}`); + console.info(`[@umijs/plugin-qiankun]: app ${name} loading ${loading}`); } if (mountElementId) { @@ -84,6 +84,9 @@ export async function render(oldRender: typeof noop) { }, }); ReactDOM.render(subApp, container); + } else if (process.env.NODE_ENV === 'development') { + console.warn(`[@umijs/plugin-qiankun]: Your ${name} app container with id ${mountElementId} is not + ready, that may cause an unexpected behavior!`); } } },