84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
var EzPanelComp = React.createClass({ render : function(){ return {this.props.title} {this.props.children} ; } });
{this.props.title}
{this.props.children}
有个题目:修改示例代码中EzPanelComp组件,为内容文字中的p元素应用样式类: .hz-indent。
新手入门,懵逼了,求大神给个提示
光阴似箭催人老,日月如移越少年。
思路:使用 顶层API React.Children.mapReact.Children.map(object children, function fn [, object context])function 里面判断是否p元素,若是加上className=“hz-indent”
相关API官方文档: http://reactjs.cn/react/docs/top-level-api.html
思路:
使用 顶层API React.Children.map
React.Children.map(object children, function fn [, object context])
function 里面判断是否p元素,若是加上className=“hz-indent”
相关API官方文档: http://reactjs.cn/react/docs/top-level-api.html