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
问题描述 组件调用父页面事件一直this.triggerEvent is not a function,
复现步骤 [复现问题的步骤]
// src/pages/index/demoPage.js import Taro, { Component } from '@tarojs/taro' import { View } from '@tarojs/components' import Demo from '../../components/demo/demo' import './index.scss' export default class DemoPage extends Component { state = {} config = { navigationBarTitleText: '首页' } closeBtn() { console.log('main close') } render() { return ( <View className='index'> <Demo onCloseBtn={this.closeBtn} /> </View> ) } } // src/components/demo/demo.js import Taro, { Component } from '@tarojs/taro' import { View } from '@tarojs/components' export default class Demo extends Component { closeEvent() { console.log('close') this.triggerEvent('closeBtn') } render() { return <View onClick={this.closeEvent.bind(this)}>DEMO</View> } } // ```
报错信息
系统信息 👽 Taro v1.3.11
Taro CLI 1.3.11 environment info: System: OS: macOS 10.14.4 Shell: 3.0.2 - /usr/local/bin/fish Binaries: Node: 12.6.0 - ~/.config/nvm/12.6.0/bin/node Yarn: 1.12.1 - /usr/local/bin/yarn npm: 6.9.0 - ~/.config/nvm/12.6.0/bin/npm
The text was updated successfully, but these errors were encountered:
欢迎提交 Issue~
如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏
如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。
Good luck and happy coding~
Sorry, something went wrong.
No branches or pull requests
问题描述
组件调用父页面事件一直this.triggerEvent is not a function,
复现步骤
[复现问题的步骤]
报错信息
系统信息
👽 Taro v1.3.11
Taro CLI 1.3.11 environment info:
System:
OS: macOS 10.14.4
Shell: 3.0.2 - /usr/local/bin/fish
Binaries:
Node: 12.6.0 - ~/.config/nvm/12.6.0/bin/node
Yarn: 1.12.1 - /usr/local/bin/yarn
npm: 6.9.0 - ~/.config/nvm/12.6.0/bin/npm
The text was updated successfully, but these errors were encountered: