antd 的Radio单选框 默认是左侧显示按钮右侧显示文字,新的需求是按钮在上方,文字在按钮下方显示.

api上也没有找到修改样式的方法,就自己替换了样式,


const radioStyle ={
display:'flex',
flexFlow:'column',
alignItems:'center',
}

在父元素 RadioGroup上设置style display:'flex',子元素用自定义的样式替换就好了

<RadioGroup style={{display:'flex'}}>
    <Radio style={radioStyle} value={1}>
          Option A
    </Radio>
</RadioGroup>

 

相关文章:

  • 2021-10-14
  • 2022-02-27
  • 2021-07-27
  • 2022-12-23
  • 2022-02-08
  • 2021-09-04
  • 2022-12-23
  • 2021-11-03
猜你喜欢
  • 2022-12-23
  • 2021-10-24
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2022-03-08
  • 2022-12-23
相关资源
相似解决方案