We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
问题描述
有Parent 组件,有方法 switchTab 和 onShareAppMessage 方法,在 class Child extends Parent 之后,onShareAppMessage 是可以正常调用的,但是 switchTab 无法调用
switchTab
onShareAppMessage
复现步骤
import Taro, { Component } from '@tarojs/taro' export default class Parent extends Component { // ---- common methods start ------- cardClick = () => { debugger } switchTab = (index, e) => { this.setState({ current: index }) } onShareAppMessage = (res) => { if (res.from === 'button') { // 来自页面内转发按钮 console.log(res.target) } return { title: 'title', path: getCurrentPageUrlWithArgs(), } } // common methods end }
import Taro, { Component } from '@tarojs/taro' import { AtTabs, AtTabsPane } from 'taro-ui' import Parent from './parent' export default class Child extends Parent { constructor() { super(...arguments) this.state = { tabList: [ { title: '列表' }, { title: '地图' }, { title: '基本信息' } ], current: 0, }; } render() { let { current, } = this.state return ( <View> {/* tabs start */} <AtTabBar fixed tabList={[ { title: '学校列表', iconType: 'list', }, { title: '地图', iconType: 'map-pin',}, { title: '简介', iconType: 'streaming', }, ]} onClick={this.switchTab} current={current} /> {/* tabs end */} <AtCard extra='详情' title='title' thumb='http://xxx.PNG' onClick={this.cardClick} > </AtCard> </View> ) } }
期望行为 希望其他方法也能被正常调用
报错信息
[这里请贴上你的完整报错截图或文字]
系统信息
The text was updated successfully, but these errors were encountered:
33c8c38
@yuche 如果绑定的事件来自父类,这里编译后就会缺少 __fn_onXxx=true
Sorry, something went wrong.
使用属性的方式定义方法:a = () => {}
fix(transformer): 即便在类中没有找到方法也要加到 $events, close #563
4fe3d53
Simbachen
yuche
No branches or pull requests
问题描述
有Parent 组件,有方法
switchTab
和onShareAppMessage
方法,在 class Child extends Parent 之后,onShareAppMessage
是可以正常调用的,但是switchTab
无法调用复现步骤
期望行为
希望其他方法也能被正常调用
报错信息
[这里请贴上你的完整报错截图或文字]
系统信息
The text was updated successfully, but these errors were encountered: