在React中修改antd的样式

it2022-06-10  81

1、在Component的Radio中加个style={radioStyle}。

<RadioGroup> <Radio style={radioStyle} value={1}>多和他人谈话</Radio> <Radio style={radioStyle} value={2}>写下计划</Radio>> </RadioGroup>

2、在style-components中写

export const radioStyle = { display: 'block', height: '30px', lineHeight: '30px', };

3、在Component中导入即可

import { radioStyle, } from './style';

4、注意两点

①要用style={radioStyle}而不是className

②注意写样式时,样式的值要加引号

 

完美修改antd的样式

转载于:https://www.cnblogs.com/piaobodewu/p/10019763.html


最新回复(0)