跳到主要内容

eo-time-range-picker

<eo-time-range-picker>

构件 eo-time-range-picker

Examples

Basic

Playground

rangeType

Playground

presetRanges

Playground

validate

Playground

selectNearDays

Playground

Events

Playground

With Form

Playground

Properties

NameDescriptionTypeDefaultRequired
name

时间段选择器字段名

string
label

时间段选择器说明

string
value

时间段选择器的初始值

TimeRange { "startTime": "00:00:00", "endTime": "23:59:59" }
required

是否必填

boolean
rangeType

时间段类型

RangeType
selectNearDays

只有rangeType在datedateTime下, 才支持只选择最近n天(当前时间向前n天)

number
emitChangeOnInitboolean true 是否在初始化完成后额外触发一次`time.range.change`, 这里因为历史原因之前默认行为就是在初始化后会触发该事件,这里为了兼容之前的行为,默认值只能设置为 true。
presetRangespresetRangeType[] [] 预设时间范围快捷选择;设置了属性selectNearDays时,属性presetRanges不生效;属性rangeType为week时,presetRanges的值只能为本周、本月、本季度、今年,属性rangeType为month、quarter、year时,以此类推
validator((value: any) => MessageBody | string)

Events

NameDescriptionEvent Detail
change

时间段变化时触发

TimeRange

Type references

TimeRange

NameTypeRequiredDescription
startTimestring
endTimestring

RangeType

PickerType & OtherPickerType

PickerType

"date" | "week" | "month" | "quarter" | "year"

OtherPickerType

"dateTime" | "hmTime" | "time"

presetRangeTypeenum

Today = "今天",
ThisWeek = "本周",
ThisMonth = "本月",
ThisQuarter = "本季度",
ThisYear = "今年",