/** * @file 组件 timeline * @author chenkai13 */ import './style/index.less'; import Base from 'santd/base'; import {classCreator} from '../core/util'; import {IItemProps} from './interface'; const prefixCls = classCreator('timeline')(); export default class Item extends Base { initData(): IItemProps { return { color: 'blue', pending: false, label: '' }; } inited(): void { this.data.set('hasDot', !!this.sourceSlots.named.dot); this.dispatch('santd_timeline_addItem', this); } getDotStyle(color: string) { if (!/blue|red|green|gray/.test(color)) { return { 'border-color': color }; } } static template = `
  • {{label}}
  • `; };