Skip to content

Commit

Permalink
fix(taro): 修复事件 bind 传参,close #1936
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Jan 15, 2019
1 parent 542db9e commit e638b50
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/taro-alipay/src/create-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function processEvent (eventHandlerName, obj) {
keyLower = keyLower.replace(/^on/, '').toLocaleLowerCase()
if (keyLower.indexOf(eventType) >= 0) {
const argName = keyLower.replace(eventType, '')
if (/^([a-z]|so)$/.test(argName)) {
if (/^(a[a-z]|so)$/.test(argName)) {
bindArgs[argName] = dataset[key]
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-swan/src/create-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function processEvent (eventHandlerName, obj) {
keyLower = keyLower.replace(/^e/, '')
if (keyLower.indexOf(eventType) >= 0) {
const argName = keyLower.replace(eventType, '')
if (/^([a-z]|so)$/.test(argName)) {
if (/^(a[a-z]|so)$/.test(argName)) {
bindArgs[argName] = dataset[key]
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-tt/src/create-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function processEvent (eventHandlerName, obj) {
keyLower = keyLower.replace(/^e/, '')
if (keyLower.indexOf(eventType) >= 0) {
const argName = keyLower.replace(eventType, '')
if (/^([a-z]|so)$/.test(argName)) {
if (/^(a[a-z]|so)$/.test(argName)) {
bindArgs[argName] = dataset[key]
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-weapp/src/create-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function processEvent (eventHandlerName, obj) {
keyLower = keyLower.replace(/^e/, '')
if (keyLower.indexOf(eventType) >= 0) {
const argName = keyLower.replace(eventType, '')
if (/^([a-z]|so)$/.test(argName)) {
if (/^(a[a-z]|so)$/.test(argName)) {
bindArgs[argName] = dataset[key]
}
}
Expand Down

0 comments on commit e638b50

Please sign in to comment.