Navigation Menu

Skip to content

Commit

Permalink
fix(transformer): 修复事件的正则判断
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed Oct 26, 2018
1 parent be7bd7c commit a282331
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/taro-transformer-wx/src/jsx.ts
Expand Up @@ -158,7 +158,7 @@ export function parseJSXElement (element: t.JSXElement): string {
let value: string | boolean = true
let attrValue = attr.value
if (typeof name === 'string') {
const isAlipayEvent = Adapter.type === Adapters.alipay && /(on[A-Z_])|(catch[A-Z_])/.test(name)
const isAlipayEvent = Adapter.type === Adapters.alipay && /(^on[A-Z_])|(^catch[A-Z_])/.test(name)
if (t.isStringLiteral(attrValue)) {
value = attrValue.value
} else if (t.isJSXExpressionContainer(attrValue)) {
Expand Down

0 comments on commit a282331

Please sign in to comment.