【问题标题】:How to align RadioButtonGroupInput of react-admin horizontally?如何水平对齐 react-admin 的 RadioButtonGroupInput?
【发布时间】:2019-11-25 21:08:49
【问题描述】:

在使用 react-admin 的 RadioButtonGroupInput 时,

RadioButtonGroupInput 的每个单选按钮总是垂直对齐。

我想水平对齐。

我尝试了很多方法,除了实现自定义组件。但没有任何效果。

<RadioButtonGroupInput source="category" choices={[
    { id: 'programming', name: 'Programming' },
    { id: 'lifestyle', name: 'Lifestyle' },
    { id: 'photography', name: 'Photography' },
]} />

垂直对齐。

【问题讨论】:

    标签: layout alignment react-admin


    【解决方案1】:

    使用此属性

    options={{'row':true}}

    <RadioButtonGroupInput source="category" choices={[
        { id: 'programming', name: 'Programming' },
        { id: 'lifestyle', name: 'Lifestyle' },
        { id: 'photography', name: 'Photography' },
        options={{'row':true}}
    ]} />
    

    然后 RadioButtonGroupInput 将选项传递给 RadioGroup 然后水平对齐。

    【讨论】:

      猜你喜欢
      • 2019-05-26
      • 2019-05-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-07
      • 2011-11-06
      • 2019-01-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多