需求:想修改antDesign样式发现修改不了

解决: 一定要在样式外面加上:global

写全局样式 :

js:

 <Form onSubmit={this.handleSubmit} className="account-form">
          <Form.Item label="邮箱">
            <Input type="email"/>
          </Form.Item>
          <Form.Item label="密码">
            <Input type="password"/>
          </Form.Item>
          <Form.Item label="确认密码">
            <Input type="password"/>
          </Form.Item>
          <Form.Item>
            <Button className="btn" type="primary">注册</Button>
          </Form.Item>
        </Form>

scss:

:global{
     .account-form{
        background-color: red;
    }
}

react-ant 修改antDesign 样式

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-06
  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
  • 2021-11-16
  • 2022-12-23
猜你喜欢
  • 2021-12-29
  • 2021-09-18
  • 2021-08-27
  • 2021-12-01
  • 2021-12-07
  • 2021-10-28
  • 2022-12-23
相关资源
相似解决方案