@mpxjs/core 2.8.19 → 2.8.20

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.8.19",
3
+ "version": "2.8.20",
4
4
  "description": "mpx runtime core",
5
5
  "keywords": [
6
6
  "miniprogram",
@@ -47,5 +47,5 @@
47
47
  "url": "https://github.com/didi/mpx/issues"
48
48
  },
49
49
  "sideEffects": false,
50
- "gitHead": "fca1b61f52c2ed8b3926e7b8a3a150d27904911a"
50
+ "gitHead": "c330d3938cc0c37843761df8b1f2deb9b6c618fc"
51
51
  }
package/src/core/proxy.js CHANGED
@@ -121,11 +121,12 @@ export default class MpxProxy {
121
121
  this.currentRenderTask = null
122
122
  }
123
123
  this.initApi()
124
- this.callHook(BEFORECREATE)
125
124
  }
126
125
 
127
126
  created () {
128
127
  if (__mpx_mode__ !== 'web') {
128
+ // web中BEFORECREATE钩子通过vue的beforeCreate钩子单独驱动
129
+ this.callHook(BEFORECREATE)
129
130
  setCurrentInstance(this)
130
131
  this.initProps()
131
132
  this.initSetup()
@@ -3,7 +3,7 @@ import mergeOptions from '../../../core/mergeOptions'
3
3
  import { diffAndCloneA, hasOwn } from '@mpxjs/utils'
4
4
  import { getCurrentInstance as getCurrentVueInstance } from '../../export/index'
5
5
  import MpxProxy, { setCurrentInstance, unsetCurrentInstance } from '../../../core/proxy'
6
- import { BEFOREUPDATE, UPDATED, BEFOREUNMOUNT, UNMOUNTED } from '../../../core/innerLifecycle'
6
+ import { BEFORECREATE, BEFOREUPDATE, UPDATED, BEFOREUNMOUNT, UNMOUNTED } from '../../../core/innerLifecycle'
7
7
 
8
8
  function filterOptions (options) {
9
9
  const newOptions = {}
@@ -30,8 +30,10 @@ function filterOptions (options) {
30
30
  function initProxy (context, rawOptions) {
31
31
  if (!context.__mpxProxy) {
32
32
  context.__mpxProxy = new MpxProxy(rawOptions, context)
33
+ context.__mpxProxy.callHook(BEFORECREATE)
33
34
  } else if (context.__mpxProxy.isUnmounted()) {
34
35
  context.__mpxProxy = new MpxProxy(rawOptions, context, true)
36
+ context.__mpxProxy.callHook(BEFORECREATE)
35
37
  }
36
38
  }
37
39