mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-30 12:28:33 +08:00
751bf40f60
* feat: update timeline to data driven
36 lines
768 B
TypeScript
36 lines
768 B
TypeScript
import React, { useState } from 'react';
|
|
import { Button, Timeline } from 'antd';
|
|
|
|
const App: React.FC = () => {
|
|
const [reverse, setReverse] = useState(false);
|
|
|
|
const handleClick = () => {
|
|
setReverse(!reverse);
|
|
};
|
|
|
|
return (
|
|
<div>
|
|
<Timeline
|
|
pending="Recording..."
|
|
reverse={reverse}
|
|
items={[
|
|
{
|
|
children: 'Create a services site 2015-09-01',
|
|
},
|
|
{
|
|
children: 'Solve initial network problems 2015-09-01',
|
|
},
|
|
{
|
|
children: 'Technical testing 2015-09-01',
|
|
},
|
|
]}
|
|
/>
|
|
<Button type="primary" style={{ marginTop: 16 }} onClick={handleClick}>
|
|
Toggle Reverse
|
|
</Button>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default App;
|