mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 09:49:57 +08:00
3269d8c387
* feat: Timeline add label * improve label style with mode * update snapshot * use optional chaining * add doc * Update label.md Co-authored-by: 偏右 <afc163@gmail.com>
1.1 KiB
1.1 KiB
order | title | ||||
---|---|---|---|---|---|
5 |
|
zh-CN
使用 label
标签单独展示时间。
en-US
Use label
show time alone.
import { useState } from 'react';
import { Timeline, Radio } from 'antd';
function TimelimeLabelDemo() {
const [mode, setMode] = useState('left');
const onChange = e => {
setMode(e.target.value);
};
return (
<>
<Radio.Group
onChange={onChange}
value={mode}
style={{
marginBottom: 20,
}}
>
<Radio value="left">Left</Radio>
<Radio value="right">Right</Radio>
<Radio value="alternate">Alternate</Radio>
</Radio.Group>
<Timeline mode={mode}>
<Timeline.Item label="2015-09-01">Create a services</Timeline.Item>
<Timeline.Item label="2015-09-01 09:12:11">Solve initial network problems</Timeline.Item>
<Timeline.Item>Technical testing</Timeline.Item>
<Timeline.Item label="2015-09-01 09:12:11">Network problems being solved</Timeline.Item>
</Timeline>
</>
);
}
ReactDOM.render(<TimelimeLabelDemo />, mountNode);