有时候我们需要有选择地设置多个className

function myComponent(props) {
    const myClassName = {
        'aaa',
        {'bbb': props.needBBB},
        {'ccc': props.needCCC}
    }
    return (
        <div className={myClassName}>
            test
        </div>
    )
}

 

相关文章:

  • 2022-12-23
  • 2021-11-19
  • 2021-05-20
  • 2022-01-20
  • 2021-12-30
  • 2022-12-23
猜你喜欢
  • 2021-06-12
  • 2022-12-23
  • 2023-01-17
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案