Skip to content

Commit

Permalink
fix(with-weapp): 修复 taroize 转换后组件事件调用 this.triggerEvent 无法触发的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Feb 15, 2019
1 parent 1c4cc6f commit 207bcdf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/taro-with-weapp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ export default function withWeapp (componentType: string) {
if (typeof eventName !== 'string') {
throw new Error('triggerEvent 第一个参数必须是字符串')
}
super.$scope.triggerEvent(eventName.toLowerCase(), ...args)
const fullEventName = `on${eventName}`
this.$scope.triggerEvent(fullEventName.toLowerCase(), ...args)
}

componentWillReceiveProps (nextProps) {
Expand Down

0 comments on commit 207bcdf

Please sign in to comment.