Timeline

Timeline 时间轴

代码示例

import { BfTimeline } from '@bud-fe/react-taro-ui';
import React from 'react';
const data = [
{ icon: 'success', title: '我是标题', content: '我是内容' },
{
icon: 'error',
title: '我是标题-我是标题我是标题我是标题我是标题我是标题我是标题我是标题我是标题',
content: '我是内容',
},
{
title: '我是标题',
content: [
{ icon: 'success', title: '发货(名称)', content: '2021-09-11 12:23:00' },
{ icon: 'success', title: '上传物流信息', content: '2021-09-11 12:23:00' },
{ icon: 'processing', title: '物流运输', content: '查看物流信息' },
],
},
{
title: '我是标题2',
content: [
{ icon: 'success', title: '上传物流信息', content: '2021-09-11 12:23:00' },
{ icon: 'processing', title: '物流运输', content: '查看物流信息' },
],
},
{ icon: 'processing', title: '我是标题', content: '我是内容' },
{ icon: 'recall', title: '我是标题', content: '我是内容' },
{ title: '我是标题', content: '我是内容' },
{
title: '我是标题-我是标题我是标题我是标题我是标题我是标题我是标题我是标题我是标题',
content: [
{ icon: 'success', title: '待客服处理(名称)审批完成', content: '2021-09-11 12:23:00' },
{ icon: 'success', title: '发货(名称)', content: '2021-09-11 12:23:00' },
{ icon: 'success', title: '上传物流信息', content: '2021-09-11 12:23:00' },
{ icon: 'processing', title: '物流运输', content: '查看物流信息' },
],
},
];
export default () => {
return (
<>
<BfTimeline title="审批流" defaultExpandedIndexArr={[data.length - 1]} data={data} />
</>
);
};

API

属性名描述类型默认值
data时间轴数据ITimelineNode[](必选)
title标题React.ReactNode--
defaultExpandedIndexArr默认展开的节点(仅针对节点的content为ITimelineSubNode[])number[]--

ITimelineNode

属性名描述类型默认值
icon节点左侧icon'success' | 'error' | 'processing' | 'recall' | React.ReactNode--
title节点标题React.ReactNode(必选)
content节点内容React.ReactNode | ITimelineSubNode[]--

ITimelineSubNode

属性名描述类型默认值
icon节点左侧icon'success' | 'error' | 'processing' | 'recall'--
title节点标题React.ReactNode(必选)
content节点内容React.ReactNode--
dumi10:24