React中的内联样式

terry React 245

React的内联样式是一个对象:

const style = {background: 'blue'}

<div style={style}>

但在实际开发中,更多地会使用命名css类这种方式,常常搭配classnames库来使用。

  • 暂无回复内容