12345678910111213141516171819202122 |
- import React from 'react';
- import './index.less';
- import Button from '../Button';
- function RadioButton(props) {
- const { list, checked, onChange } = props;
- return (
- <div className="radio-button">
- {list.map(item => {
- return (
- <Button theme={item.key === checked ? 'theme' : 'default'} size="small" radius onClick={() => {
- if (onChange) onChange(item);
- }}>
- {item.title}
- </Button>
- );
- })}
- </div>
- );
- }
- RadioButton.propTypes = {};
- export default RadioButton;
|