@mpxjs/core 2.8.24 → 2.8.26
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.
|
|
3
|
+
"version": "2.8.26",
|
|
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": "
|
|
50
|
+
"gitHead": "6ff72e991d40cab03e44a9b82a1849bd383de83b"
|
|
51
51
|
}
|
package/src/observer/effect.js
CHANGED
|
@@ -105,10 +105,10 @@ export class ReactiveEffect {
|
|
|
105
105
|
this.pausedState = PausedState.paused
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
resume () {
|
|
108
|
+
resume (ignoreDirty = false) {
|
|
109
109
|
const lastPausedState = this.pausedState
|
|
110
110
|
this.pausedState = PausedState.resumed
|
|
111
|
-
if (lastPausedState === PausedState.dirty) {
|
|
111
|
+
if (!ignoreDirty && lastPausedState === PausedState.dirty) {
|
|
112
112
|
this.scheduler ? this.scheduler() : this.run()
|
|
113
113
|
}
|
|
114
114
|
}
|
|
@@ -73,15 +73,15 @@ class EffectScope {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
resume () {
|
|
76
|
+
resume (ignoreDirty = false) {
|
|
77
77
|
if (this.active) {
|
|
78
78
|
let i, l
|
|
79
79
|
for (i = 0, l = this.effects.length; i < l; i++) {
|
|
80
|
-
this.effects[i].resume()
|
|
80
|
+
this.effects[i].resume(ignoreDirty)
|
|
81
81
|
}
|
|
82
82
|
if (this.scopes) {
|
|
83
83
|
for (i = 0, l = this.scopes.length; i < l; i++) {
|
|
84
|
-
this.scopes[i].resume()
|
|
84
|
+
this.scopes[i].resume(ignoreDirty)
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CREATED, BEFORECREATE, BEFOREUPDATE, UNMOUNTED } from '../../core/innerLifecycle'
|
|
1
|
+
import { CREATED, BEFORECREATE, BEFOREMOUNT, BEFOREUPDATE, UNMOUNTED } from '../../core/innerLifecycle'
|
|
2
2
|
import { noop, error, getEnvObj } from '@mpxjs/utils'
|
|
3
3
|
|
|
4
4
|
const envObj = getEnvObj()
|
|
@@ -38,6 +38,9 @@ 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
|
|
41
44
|
this.__getRefs()
|
|
42
45
|
},
|
|
43
46
|
[BEFOREUPDATE] () {
|