-
react组件的样式和逻辑写在一起,
把样式以json的格式写在对象中,
通过style关键字={样式对象}绑定到一起。
查看全部 -
react组件类最新的写法为:
class HelloWorld extends React.Component { render() { return ( <div> <p>Hello, {this.props.greetTarget}</p> </div> ) } }
查看全部 -
在指定类名时,一定要使用className,不能用class(class是React的一个关键字)
this.props.children对应的相应组件标签中的内容。
查看全部 -
安装python服务器
查看全部 -
属性,状态,生命周期
查看全部 -
{...this.props} es6属性扩展 获取父组件的所有属性集
查看全部 -
属性扩展操作:{...props}
查看全部 -
shouldComponentUpdate返回false时,界面不变化,但状态依然变化
查看全部 -
shouldComponentUpdate返回true则表示接受更新
查看全部 -
getDefaultProps和getInitialState在es6中被去掉了
查看全部 -
React组件声明周期函数:
componentWillMount
componentDidMount
componentWillUnmount
componentWillUpdate
componentDidUpdate
shouldComponentUpdate
componentWillReceiveProps
查看全部 -
三个点...的操作符可以融合父子对象
查看全部 -
JavaScript的toLocaleString函数将数字转换为本地字符串
查看全部 -
es6中需要在构造函数中调用this.timerTick = this.timerTick.bind(this);
查看全部 -
componentDidMount实在初始化之后被渲染之前调用的函数
查看全部
举报