diff --git a/packages/amis-editor/src/plugin/Timeline.tsx b/packages/amis-editor/src/plugin/Timeline.tsx index 3d6df6dc2..27247d0cc 100644 --- a/packages/amis-editor/src/plugin/Timeline.tsx +++ b/packages/amis-editor/src/plugin/Timeline.tsx @@ -20,8 +20,9 @@ export class TimelinePlugin extends BasePlugin { label: '时间轴', name: 'timeline', items: [ - {time: '2012-12-21', title: '节点数据'}, - {time: '2012-12-24', title: '节点数据'} + {time: '2012-12-21', title: '节点示例数据'}, + {time: '2012-12-24', title: '节点示例数据'}, + {time: '2012-12-27', title: '节点示例数据'} ] }; previewSchema = { diff --git a/packages/amis-editor/src/renderer/TimelineItemControl.tsx b/packages/amis-editor/src/renderer/TimelineItemControl.tsx index f74812d9e..93cbc3e5c 100644 --- a/packages/amis-editor/src/renderer/TimelineItemControl.tsx +++ b/packages/amis-editor/src/renderer/TimelineItemControl.tsx @@ -77,6 +77,9 @@ export default class TimelineItemControl extends React.Component< data.items = items.map(item => ({...item})); } if (source === 'api') { + const {items, api} = this.state; + data.items = items.map(item => ({...item})); + data.source = api; } onBulkChange && onBulkChange(data); } @@ -396,6 +399,7 @@ export default class TimelineItemControl extends React.Component< renderOption(props: TimelineItem & {index: number}) { const {time, title, index} = props; + const delDisabled = !(this.state.items.length > 2); return (