@mpxjs/core 2.10.17-beta.4 → 2.10.17-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/core",
3
- "version": "2.10.17-beta.4",
3
+ "version": "2.10.17-beta.5",
4
4
  "description": "mpx runtime core",
5
5
  "keywords": [
6
6
  "miniprogram",
@@ -295,13 +295,17 @@ function createInstance ({ propsRef, type, rawOptions, currentInject, validProps
295
295
  instance[key] = method.bind(instance)
296
296
  })
297
297
  }
298
-
298
+ const loadParams = {}
299
299
  if (type === 'page') {
300
300
  const props = propsRef.current
301
301
  instance.route = props.route.name
302
302
  global.__mpxPagesMap = global.__mpxPagesMap || {}
303
303
  global.__mpxPagesMap[props.route.key] = [instance, props.navigation]
304
304
  setFocusedNavigation(props.navigation)
305
+
306
+ if (!global.__mpxAppHotLaunched && global.__mpxInitialRunParams) {
307
+ Object.assign(loadParams, global.__mpxInitialRunParams)
308
+ }
305
309
  set(global.__mpxPageSizeCountMap, pageId, global.__mpxSizeCount)
306
310
  // App onLaunch 在 Page created 之前执行
307
311
  if (!global.__mpxAppHotLaunched && global.__mpxAppOnLaunch) {
@@ -311,11 +315,10 @@ function createInstance ({ propsRef, type, rawOptions, currentInject, validProps
311
315
 
312
316
  const proxy = instance.__mpxProxy = new MpxProxy(rawOptions, instance)
313
317
  proxy.created()
314
-
315
318
  if (type === 'page') {
316
319
  const props = propsRef.current
317
320
  const decodedQuery = {}
318
- const rawQuery = props.route.params || {}
321
+ const rawQuery = Object.assign({}, loadParams, props.route.params || {})
319
322
  if (isObject(rawQuery)) {
320
323
  for (const key in rawQuery) {
321
324
  decodedQuery[key] = decodeURIComponent(rawQuery[key])