@mpxjs/core 2.8.51 → 2.8.53
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 +3 -3
- package/src/core/proxy.js +7 -4
- package/src/index.js +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpxjs/core",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.53",
|
|
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.8.
|
|
22
|
+
"@mpxjs/utils": "^2.8.52",
|
|
23
23
|
"lodash": "^4.1.1",
|
|
24
24
|
"miniprogram-api-typings": "^3.10.0"
|
|
25
25
|
},
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"url": "https://github.com/didi/mpx/issues"
|
|
48
48
|
},
|
|
49
49
|
"sideEffects": false,
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "cad6b8f0d2b1c8e520bfafa1de3bbf332466d801"
|
|
51
51
|
}
|
package/src/core/proxy.js
CHANGED
|
@@ -26,7 +26,8 @@ import {
|
|
|
26
26
|
getFirstKey,
|
|
27
27
|
callWithErrorHandling,
|
|
28
28
|
warn,
|
|
29
|
-
error
|
|
29
|
+
error,
|
|
30
|
+
getEnvObj
|
|
30
31
|
} from '@mpxjs/utils'
|
|
31
32
|
import {
|
|
32
33
|
BEFORECREATE,
|
|
@@ -45,6 +46,8 @@ import {
|
|
|
45
46
|
|
|
46
47
|
let uid = 0
|
|
47
48
|
|
|
49
|
+
const envObj = getEnvObj()
|
|
50
|
+
|
|
48
51
|
class RenderTask {
|
|
49
52
|
resolved = false
|
|
50
53
|
|
|
@@ -235,14 +238,14 @@ export default class MpxProxy {
|
|
|
235
238
|
const setupResult = callWithErrorHandling(setup, this, 'setup function', [
|
|
236
239
|
this.props,
|
|
237
240
|
{
|
|
238
|
-
triggerEvent: this.target.triggerEvent.bind(this.target),
|
|
241
|
+
triggerEvent: this.target.triggerEvent ? this.target.triggerEvent.bind(this.target) : noop,
|
|
239
242
|
refs: this.target.$refs,
|
|
240
243
|
asyncRefs: this.target.$asyncRefs,
|
|
241
244
|
forceUpdate: this.forceUpdate.bind(this),
|
|
242
245
|
selectComponent: this.target.selectComponent.bind(this.target),
|
|
243
246
|
selectAllComponents: this.target.selectAllComponents.bind(this.target),
|
|
244
|
-
createSelectorQuery: this.target.createSelectorQuery.bind(this.target),
|
|
245
|
-
createIntersectionObserver: this.target.createIntersectionObserver.bind(this.target)
|
|
247
|
+
createSelectorQuery: this.target.createSelectorQuery ? this.target.createSelectorQuery.bind(this.target) : envObj.createSelectorQuery.bind(envObj),
|
|
248
|
+
createIntersectionObserver: this.target.createIntersectionObserver ? this.target.createIntersectionObserver.bind(this.target) : envObj.createIntersectionObserver.bind(envObj)
|
|
246
249
|
}
|
|
247
250
|
])
|
|
248
251
|
if (!isObject(setupResult)) {
|
package/src/index.js
CHANGED
|
@@ -135,7 +135,13 @@ Mpx.config = {
|
|
|
135
135
|
proxyEventHandler: null,
|
|
136
136
|
setDataHandler: null,
|
|
137
137
|
forceFlushSync: false,
|
|
138
|
-
webRouteConfig: {}
|
|
138
|
+
webRouteConfig: {},
|
|
139
|
+
/*
|
|
140
|
+
支持两个属性
|
|
141
|
+
hostWhitelists Array 类型 支持h5域名白名单安全校验
|
|
142
|
+
apiImplementations webview JSSDK接口 例如getlocation
|
|
143
|
+
*/
|
|
144
|
+
webviewConfig: {}
|
|
139
145
|
}
|
|
140
146
|
|
|
141
147
|
global.__mpx = Mpx
|