摘要: 背景 平常写组件,经常遇到需要获取内容放入组件内部的情形。 实现方法 我们有两种实现方式 1. 自定义 props render 的时候通过获取 this.props.content 填充到组件内部 2. 利用 props 的 children 一般 props 是与用户定义的组件一一对应,但有一个 阅读全文
posted @ 2017-03-14 16:33 空城夕 阅读(1783) 评论(0) 推荐(0) 编辑