@mpxjs/core 2.9.48 → 2.9.57
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.9.
|
|
3
|
+
"version": "2.9.57",
|
|
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.9.
|
|
22
|
+
"@mpxjs/utils": "^2.9.50",
|
|
23
23
|
"lodash": "^4.1.1",
|
|
24
24
|
"miniprogram-api-typings": "^3.10.0"
|
|
25
25
|
},
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"url": "https://github.com/didi/mpx/issues"
|
|
82
82
|
},
|
|
83
83
|
"sideEffects": false,
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "f52627676fd798818980c2d1a6890c5ea99e2862"
|
|
85
85
|
}
|
|
@@ -74,6 +74,13 @@ export default function install (Vue) {
|
|
|
74
74
|
}
|
|
75
75
|
})
|
|
76
76
|
|
|
77
|
+
Vue.prototype.__ensureString = function (val) {
|
|
78
|
+
if (typeof val === 'string') {
|
|
79
|
+
return val
|
|
80
|
+
}
|
|
81
|
+
return JSON.stringify(val) + 'MpxEscape'
|
|
82
|
+
}
|
|
83
|
+
|
|
77
84
|
Vue.prototype.triggerEvent = function (eventName, eventDetail) {
|
|
78
85
|
// 输出Web时自定义组件绑定click事件会和web原生事件冲突,组件内部triggerEvent时会导致事件执行两次,将click事件改为_click来规避此问题
|
|
79
86
|
const escapeEvents = ['click']
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { error } from '@mpxjs/utils'
|
|
1
|
+
import { error, setByPath } from '@mpxjs/utils'
|
|
2
2
|
import Mpx from '../../index'
|
|
3
3
|
|
|
4
4
|
export default function proxyEventMixin () {
|
|
@@ -33,15 +33,15 @@ export default function proxyEventMixin () {
|
|
|
33
33
|
}
|
|
34
34
|
})
|
|
35
35
|
return returnedValue
|
|
36
|
+
},
|
|
37
|
+
__model (expr, $event, valuePath = ['value'], filterMethod) {
|
|
38
|
+
const innerFilter = {
|
|
39
|
+
trim: val => typeof val === 'string' && val.trim()
|
|
40
|
+
}
|
|
41
|
+
const originValue = valuePath.reduce((acc, cur) => acc[cur], $event.detail)
|
|
42
|
+
const value = filterMethod ? (innerFilter[filterMethod] ? innerFilter[filterMethod](originValue) : typeof this[filterMethod] === 'function' ? this[filterMethod](originValue) : originValue) : originValue
|
|
43
|
+
setByPath(this, expr, value)
|
|
36
44
|
}
|
|
37
|
-
// __model (expr, $event, valuePath = ['value'], filterMethod) {
|
|
38
|
-
// const innerFilter = {
|
|
39
|
-
// trim: val => typeof val === 'string' && val.trim()
|
|
40
|
-
// }
|
|
41
|
-
// const originValue = valuePath.reduce((acc, cur) => acc[cur], $event.detail)
|
|
42
|
-
// const value = filterMethod ? (innerFilter[filterMethod] ? innerFilter[filterMethod](originValue) : typeof this[filterMethod] === 'function' ? this[filterMethod](originValue) : originValue) : originValue
|
|
43
|
-
// setByPath(this, expr, value)
|
|
44
|
-
// }
|
|
45
45
|
}
|
|
46
46
|
return {
|
|
47
47
|
methods
|