0

我怎样才能让“其他”变成一个按钮,用户可以在其中输入任意数量的钱?我尝试使用按钮创建一个 const other 并将 {other} 放在选项选项卡中,例如 options={['$5', '$10', '$20', '$50', '$100', {other}]} 但是那没有用。我正在使用 Grommet UI,欢迎提出任何建议。谢谢你。

           <RadioButtonGroup direction="row" required
           gap="xlarge"
           id="example2-id"
           name="example2"
           options={['$5', '$10', '$20', '$50', '$100', 'other']}
           />
4

1 回答 1

0

单选按钮返回一个预设值,如果您想允许用户输入自定义值,我建议在您的单选按钮下添加一个 TextInput 并将其包装在一个表单中。

于 2021-04-28T23:28:07.190 回答