Merge branch 'feat/runtime-trans-params' into 'release/1.0.0'

feat: createApp时拿取onReady的入参



See merge request !1032274
This commit is contained in:
荣彬 2020-11-03 10:41:47 +08:00
commit fa3291f193
2 changed files with 4 additions and 3 deletions

View File

@ -250,7 +250,8 @@ export default class Provider {
}
// 定制构造根组件的逻辑,如切换路由机制
createApp() {
// eslint-disable-next-line
createApp(params?: any) {
throw new Error('Method called "createApp" not implemented.');
}

View File

@ -28,13 +28,13 @@ export default function runApp() {
if (!provider) {
throw new Error('Please register class Provider');
}
provider.onReady(() => {
provider.onReady((params) => {
const promise = provider.async();
promise.then((config: IAppConfig) => {
if (!config) {
return;
}
const App = provider.createApp();
const App = provider.createApp(params);
provider.runApp(App, config);
}).catch((err: Error) => {
console.error(err.message);