日期按钮组件
Radio.Group options 动态渲染
import { Radio } from 'antd';
const options = [
{ label: '1小时', value: 1 },
{ label: '6小时', value: 6 },
{ label: '12小时', value: 12 },
{ label: '1天', value: 24 },
{ label: '3天', value: 72' },
{ label: '5天', value: 120 },
]
function App() {
function radioChange(e) {
e.target.value
}
return (
<Form.Item label="时间">
<Radio.Group
value={1}
onChange={radioChange}
options={options}
optionType="button"
buttonStyle="solid"
/>
</Form.Item>
)
}
Radio组件参考资料
https://ant-design.antgroup.com/components/radio-cn
https://3x.ant.design/components/radio-cn
日期联动
移动端日期场景
用户数据
const today = []
const yesterday = []