Zha*_* Yi 5 javascript ecmascript-6 reactjs
{...this.props}这段代码意味着什么?
<div {...this.props} style={{ height: `100%`, }}
ROA*_*OAL 11
该{...variable}语法被称为"传播属性".
它的作用基本上是它采用this.props(或任何其他传递的变量)的每个属性并将它们应用于元素.
例:
props = {className: 'big', href: 'http://example.com'};
<a {...props} />
// the above line is equal to the following
<a className="big" href="http://example.com" />
| 归档时间: | 
 | 
| 查看次数: | 4251 次 | 
| 最近记录: |