diff --git a/packages/taro-transformer-wx/src/class.ts b/packages/taro-transformer-wx/src/class.ts index b42693bc18c0..4bf0339b69b0 100644 --- a/packages/taro-transformer-wx/src/class.ts +++ b/packages/taro-transformer-wx/src/class.ts @@ -394,7 +394,7 @@ class Transformer { } else if (t.isMemberExpression(expr)) { self.buildAnonymousFunc(attr, expr as any, false) } else { - throw codeFrameError(expr.loc, '组件事件传参只能在类作用域下的确切引用(this.handleXX || this.props.handleXX),或使用 bind。') + throw codeFrameError(path.node, '组件事件传参只能在类作用域下的确切引用(this.handleXX || this.props.handleXX),或使用 bind。') } } const jsx = path.findParent(p => p.isJSXOpeningElement()) as NodePath