eo-time-range-picker
<eo-time-range-picker>
构件 eo-time-range-picker
Examples
Basic
rangeType
presetRanges
validate
selectNearDays
Events
With Form
Properties
Name | Description | Type | Default | Required |
---|---|---|---|---|
name | 时间段选择器字段名 | string | ||
label | 时间段选择器说明 | string | ||
value | 时间段选择器的初始值 | TimeRange | { "startTime": "00:00:00", "endTime": "23:59:59" } | |
required | 是否必填 | boolean | ||
rangeType | 时间段类型 | RangeType | ||
selectNearDays | 只有rangeType在 | number | ||
emitChangeOnInit | boolean | true
是否在初始化完成后额外触发一次`time.range.change`, 这里因为历史原因之前默认行为就是在初始化后会触发该事件,这里为了兼容之前的行为,默认值只能设置为 true。 | ||
presetRanges | presetRangeType[] | []
预设时间范围快捷选择;设置了属性selectNearDays时,属性presetRanges不生效;属性rangeType为week时,presetRanges的值只能为本周、本月、本季度、今年,属性rangeType为month、quarter、year时,以此类推 | ||
validator | ((value: any) => MessageBody | string) |
Events
Name | Description | Event Detail |
---|---|---|
change | 时间段变化时触发 | TimeRange |
Type references
TimeRange
Name | Type | Required | Description |
---|---|---|---|
startTime | string | ✅ | |
endTime | string | ✅ |
RangeType
PickerType & OtherPickerType
PickerType
"date" | "week" | "month" | "quarter" | "year"
OtherPickerType
"dateTime" | "hmTime" | "time"
presetRangeTypeenum
Today = "今天",
ThisWeek = "本周",
ThisMonth = "本月",
ThisQuarter = "本季度",
ThisYear = "今年",