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
请问为什么自定义组件不能使用children呢? 这应该是比较常用的需求了,定义一个或多个布局组件,�然后页面上只需要引入所需的布局组件就好了。
在H5模式下貌似没发现总是,但是打包成小程序后无法使用。
import Taro, { Component } from '@tarojs/taro' import { View } from '@tarojs/components' import AppHeader from '../common/AppHeader.js' export default class MainLayout extends Component { render () { return ( <View className='MainLayout'> <AppHeader backicon={this.props.backicon} title={this.props.title}></AppHeader> <View className='Main'> {this.props.children} </View> </View> ) } }
The text was updated successfully, but these errors were encountered:
因为目前小程序内置的组件化方案才能用 slot,但是内置组件化不能通过 props 传函数,所以我们自己目前做的一套组件化系统可以传函数,但不能传组件。
slot
props
文档也有写: https://nervjs.github.io/taro/jsx.html
Sorry, something went wrong.
明白了,谢谢。
No branches or pull requests
请问为什么自定义组件不能使用children呢?
这应该是比较常用的需求了,定义一个或多个布局组件,�然后页面上只需要引入所需的布局组件就好了。
在H5模式下貌似没发现总是,但是打包成小程序后无法使用。
The text was updated successfully, but these errors were encountered: