我正在尝试将一组react-bootstrap按钮制作成单选按钮集。我可以很容易地使用bootstrap和
JS:
<input type="radio">
元素来实现这一点,但是不知道如何在react-bootstrap中实现。以下代码允许用户选择每个按钮,而不仅仅是一个。JS:
const operationButtons = (
<ButtonGroup>
<Button active>Radio 1</Button>
<Button>Radio 2</Button>
</ButtonGroup>
);
React.render(operationButtons, document.getElementById('operationButtonsDiv'));
HTML:
<div name="operationButtonsDiv" id="operationButtonsDiv" data-toggle="buttons"/>