@mpxjs/core 2.10.15 → 2.10.16
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.
|
|
3
|
+
"version": "2.10.16",
|
|
4
4
|
"description": "mpx runtime core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"miniprogram",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
],
|
|
20
20
|
"main": "src/index.js",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@mpxjs/utils": "^2.10.
|
|
22
|
+
"@mpxjs/utils": "^2.10.16",
|
|
23
23
|
"lodash": "^4.1.1",
|
|
24
24
|
"miniprogram-api-typings": "^3.10.0"
|
|
25
25
|
},
|
|
@@ -109,5 +109,5 @@
|
|
|
109
109
|
"url": "https://github.com/didi/mpx/issues"
|
|
110
110
|
},
|
|
111
111
|
"sideEffects": false,
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "be4129320e298edf935ea35f9ca3d375f75ac51c"
|
|
113
113
|
}
|
|
@@ -241,7 +241,7 @@ export default function styleHelperMixin () {
|
|
|
241
241
|
overflow: 'hidden'
|
|
242
242
|
})
|
|
243
243
|
}
|
|
244
|
-
const isEmpty = isNativeStaticStyle ? result.length
|
|
244
|
+
const isEmpty = isNativeStaticStyle ? !result.length : isEmptyObject(result)
|
|
245
245
|
return isEmpty ? empty : result
|
|
246
246
|
}
|
|
247
247
|
}
|
|
@@ -108,7 +108,7 @@ export default function createApp (options) {
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
const appState = reactive({ state: '' })
|
|
111
|
-
// TODO
|
|
111
|
+
// TODO reason 目前支持模拟 0/3
|
|
112
112
|
// 0用户退出小程序
|
|
113
113
|
// 1进入其他小程序
|
|
114
114
|
// 2打开原生功能页
|
|
@@ -136,12 +136,10 @@ export default function createApp (options) {
|
|
|
136
136
|
global.__mpxAppCbs.show.forEach((cb) => {
|
|
137
137
|
cb(options)
|
|
138
138
|
})
|
|
139
|
-
} else if (value === 'hide') {
|
|
140
|
-
|
|
141
|
-
delete appState.hideReason
|
|
142
|
-
global.__mpxAppCbs.hide.forEach((cb) => {
|
|
139
|
+
} else if (value === 'hide' || value === 'exit') {
|
|
140
|
+
global.__mpxAppCbs.hide.forEach((cb) => {
|
|
143
141
|
cb({
|
|
144
|
-
reason
|
|
142
|
+
reason: value === 'exit' ? 0 : 3
|
|
145
143
|
})
|
|
146
144
|
})
|
|
147
145
|
}
|
|
@@ -154,7 +152,6 @@ export default function createApp (options) {
|
|
|
154
152
|
global.__mpxPageStatusMap[navigation.pageId] = 'show'
|
|
155
153
|
}
|
|
156
154
|
} else if (currentState === 'inactive' || currentState === 'background') {
|
|
157
|
-
appState.hideReason = 3
|
|
158
155
|
appState.state = 'hide'
|
|
159
156
|
if (navigation && hasOwn(global.__mpxPageStatusMap, navigation.pageId)) {
|
|
160
157
|
global.__mpxPageStatusMap[navigation.pageId] = 'hide'
|
|
@@ -224,8 +221,7 @@ export default function createApp (options) {
|
|
|
224
221
|
}
|
|
225
222
|
})
|
|
226
223
|
return () => {
|
|
227
|
-
appState.
|
|
228
|
-
appState.state = 'hide'
|
|
224
|
+
appState.state = 'exit'
|
|
229
225
|
changeSubscription && changeSubscription.remove()
|
|
230
226
|
resizeSubScription && resizeSubScription.remove()
|
|
231
227
|
}
|