助力软件开发企业降本增效 PHP / java源码系统,只需一次付费,代码终身使用! 广告
[TOC] ## 钙素 把值放入 ## 包含关系 ``` class Demo extends Component{ constructor(props) { super(props); } render() { return ( <div> <p>hello</p> {this.props.children} <p>hello</p> </div> ) } } class App extends Component{ constructor(props) { super(props); } render() { return( <div> <Demo> <h1>word</h1> </Demo> </div> ) } } ``` ## 槽 ``` class Demo extends Component{ constructor(props) { super(props); } render() { return ( <div> <p>hello</p> {this.props.left} <p>hello</p> {this.props.right} <p>hello</p> </div> ) } } class App extends Component{ constructor(props) { super(props); } render() { return( <div> 注意,使用了一个闭合标签 <Demo left={ <h1>leftleft</h1> } right={ <h1>rightright</h1> } /> </div> ) } } ```