@mpxjs/core 2.7.37 → 2.7.43

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.7.37",
3
+ "version": "2.7.43",
4
4
  "description": "mpx runtime core",
5
5
  "keywords": [
6
6
  "miniprogram",
@@ -41,5 +41,5 @@
41
41
  "url": "https://github.com/didi/mpx/issues"
42
42
  },
43
43
  "sideEffects": false,
44
- "gitHead": "b39b466d24c97264ee096c91747dbb922422b122"
44
+ "gitHead": "9ba777d5b52c8a2f802c47c2dc10c6984deff1d8"
45
45
  }
@@ -70,13 +70,10 @@ export default function proxyEventMixin () {
70
70
  }
71
71
  }
72
72
  if (__mpx_mode__ === 'ali') {
73
- const getHandler = (eventName, props) => {
74
- const handlerName = eventName.replace(/^./, matched => matched.toUpperCase()).replace(/-([a-z])/g, (match, p1) => p1.toUpperCase())
75
- return props && (props['on' + handlerName] || props['catch' + handlerName])
76
- }
77
73
  Object.assign(methods, {
78
74
  triggerEvent (eventName, eventDetail) {
79
- const handler = getHandler(eventName, this.props)
75
+ const handlerName = eventName.replace(/^./, matched => matched.toUpperCase()).replace(/-([a-z])/g, (match, p1) => p1.toUpperCase())
76
+ const handler = this.props && (this.props['on' + handlerName] || this.props['catch' + handlerName])
80
77
  if (handler && typeof handler === 'function') {
81
78
  const dataset = collectDataset(this.props)
82
79
  const id = this.props.id || ''
@@ -95,31 +92,6 @@ export default function proxyEventMixin () {
95
92
  },
96
93
  detail: eventDetail
97
94
  }
98
- handler.call(this, eventObj)
99
- }
100
- },
101
- __proxyEvent (e) {
102
- const type = e.type
103
- const handler = getHandler(type, this.props)
104
-
105
- if (handler && typeof handler === 'function') {
106
- const dataset = collectDataset(this.props)
107
- const id = this.props.id || ''
108
- const targetData = Object.assign({}, e.target || {}, {
109
- id,
110
- dataset
111
- })
112
-
113
- const currentTargetData = Object.assign({}, e.currentTarget || {}, {
114
- id,
115
- dataset
116
- })
117
-
118
- const eventObj = Object.assign({}, e, {
119
- target: targetData,
120
- currentTarget: currentTargetData
121
- })
122
-
123
95
  handler.call(this, eventObj)
124
96
  }
125
97
  }