mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-15 17:31:25 +08:00
b9a6b7b578
* demo: update demo * add form * clear * add Select * add * fix style * fix style * fix * revert
24 lines
626 B
TypeScript
24 lines
626 B
TypeScript
import React, { useState } from 'react';
|
|
import { Segmented, Button, Space } from 'antd';
|
|
|
|
const Demo: React.FC = () => {
|
|
const [options, setOptions] = useState(['Daily', 'Weekly', 'Monthly']);
|
|
const [moreLoaded, setMoreLoaded] = useState(false);
|
|
|
|
const handleLoadOptions = () => {
|
|
setOptions((prev) => [...prev, 'Quarterly', 'Yearly']);
|
|
setMoreLoaded(true);
|
|
};
|
|
|
|
return (
|
|
<Space direction="vertical">
|
|
<Segmented options={options} />
|
|
<Button type="primary" disabled={moreLoaded} onClick={handleLoadOptions}>
|
|
Load more options
|
|
</Button>
|
|
</Space>
|
|
);
|
|
};
|
|
|
|
export default Demo;
|