@mpxjs/core 2.8.26 → 2.8.28-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.8.26",
3
+ "version": "2.8.28-beta.5",
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": "6ff72e991d40cab03e44a9b82a1849bd383de83b"
50
+ "gitHead": "f415e2d6a1c14b51b2cee6eb654205608f217401"
51
51
  }
package/src/core/proxy.js CHANGED
@@ -183,6 +183,7 @@ export default class MpxProxy {
183
183
  unmounted () {
184
184
  this.callHook(BEFOREUNMOUNT)
185
185
  this.scope?.stop()
186
+ if (this.update) this.update.active = false
186
187
  this.callHook(UNMOUNTED)
187
188
  this.state = UNMOUNTED
188
189
  }
@@ -1,4 +1,4 @@
1
- import { CREATED, BEFORECREATE, BEFOREMOUNT, BEFOREUPDATE, UNMOUNTED } from '../../core/innerLifecycle'
1
+ import { CREATED, BEFORECREATE, BEFOREUPDATE, UNMOUNTED } from '../../core/innerLifecycle'
2
2
  import { noop, error, getEnvObj } from '@mpxjs/utils'
3
3
 
4
4
  const envObj = getEnvObj()
@@ -38,9 +38,6 @@ export default function getRefsMixin () {
38
38
  this.$asyncRefs = {}
39
39
  this.__refCacheMap = new Map()
40
40
  this.__asyncRefCacheMap = new Map()
41
- },
42
- [BEFOREMOUNT] () {
43
- // 避免在create/attached阶段获取未初始化完成的子组件实例,初始化refs时机延后至beforeMount
44
41
  this.__getRefs()
45
42
  },
46
43
  [BEFOREUPDATE] () {
@@ -102,6 +99,7 @@ export default function getRefsMixin () {
102
99
  createSelectorQuery (...args) {
103
100
  const selectorQuery = envObj.createSelectorQuery(...args)
104
101
  const cbs = []
102
+
105
103
  proxyMethods.forEach((name) => {
106
104
  const originalMethod = selectorQuery[name]
107
105
  selectorQuery[name] = function (cb = noop) {
@@ -38,6 +38,7 @@ const noop = () => {
38
38
  const fixEffectScope = (scope) => {
39
39
  scope.pause = noop
40
40
  scope.resume = noop
41
+ return scope
41
42
  }
42
43
 
43
44
  const effectScope = (detached) => fixEffectScope(vueEffectScope(detached))