Skip to content

Commit

Permalink
fix(taro): 小程序端事件处理事件名类似时参数绑定错误,close NervJS#1866
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Jan 14, 2019
1 parent 7bf3681 commit 166857b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/create-component.js
Expand Up @@ -124,10 +124,11 @@ function processEvent (eventHandlerName, obj) {
if (/^e/.test(keyLower)) {
// 小程序属性里中划线后跟一个下划线会解析成不同的结果
keyLower = keyLower.replace(/^e/, '')
keyLower = keyLower.toLocaleLowerCase()
if (keyLower.indexOf(eventType) >= 0) {
const argName = keyLower.replace(eventType, '')
bindArgs[argName] = dataset[key]
if (/^([a-z]|so)$/.test(argName)) {
bindArgs[argName] = dataset[key]
}
}
}
})
Expand Down

0 comments on commit 166857b

Please sign in to comment.