TimePicker 时间选择器

用于输入时间。

任意时间点

可以选择任意时间。

限制时间范围

您也可以限制时间范围。

任意时间范围

可以选择任意时间范围。

API

属性

名称描述类型默认值
model-value / v-model绑定值,如果它是数组,长度应该是 2number / string / object''
只读时间选择器是否只读booleanfalse
disabled时间选择器是否被禁用booleanfalse
可编辑输入框是否可编辑booleantrue
可清空是否显示清除按钮booleantrue
size输入框尺寸枚举
占位符非范围选择时的占位内容string''
start-placeholder范围选择时开始时间的占位内容string
end-placeholder范围选择时结束时间的占位内容string
is-range是否为时间范围选择booleanfalse
arrow-control是否使用箭头进行时间选择booleanfalse
popper-classTimePicker 下拉框的自定义类名string''
popper-styleTimePicker 下拉框的自定义样式string / object
popper-options自定义 popper 选项,更多请看 popper.jsobject{}
fallback-placements 2.8.4Tooltip 的可能位置列表 popper.jsarray['bottom', 'top', 'right', 'left']
placement 2.8.4下拉框出现的位置位置bottom
range-separator选择范围时的分隔符string'-'
format输入框中显示值的格式string 详见 日期格式
default-value可选,选择器打开时默认显示的时间Date / object
value-format可选,绑定值的格式。 如果未指定,则绑定值为 Date 对象string 详见 日期格式
id与原生 input 的 `id` 属性相同string / object
名称与原生输入框的 `name` 相同string''
aria-label a11y 2.7.2与原生输入框的 `aria-label` 相同string
前缀图标自定义前缀图标组件string / Component时钟
clear-icon自定义清除图标组件string / ComponentCircleClose
disabled-hours指定不可选择的小时数组Function
disabled-minutes指定不可选择的分钟数组Function
disabled-seconds指定不可选择的秒数数组Function
teleported时间选择器下拉框是否插入到 body 元素上booleantrue
tabindex输入框的 tabindexstring / number0
empty-values 2.7.0组件的空值,参见 config-providerarray
value-on-clear 2.7.0清除返回值,参见 config-providerstring / number / boolean / Function
label a11y 已废弃与原生输入框的 `aria-label` 相同string

事件

名称描述类型
change当用户确认选定的值时触发Function
blur在 Input 失去焦点时触发Function
focus在 Input 获得焦点时触发Function
clear 2.7.7在可清空的时间选择器中点击清空图标时触发Function
visible-change当 TimePicker 的下拉列表出现/消失时触发Function

暴露

名称描述类型
focus聚焦 TimePicker 组件Function
blur使 TimePicker 组件失焦Function
handleOpen 2.2.16打开 TimePicker 弹窗Function
handleClose 2.2.16关闭 TimePicker 弹窗Function

类型声明

显示声明
ts
type Placement =
  | 'top'
  | 'top-start'
  | 'top-end'
  | 'bottom'
  | 'bottom-start'
  | 'bottom-end'
  | 'left'
  | 'left-start'
  | 'left-end'
  | 'right'
  | 'right-start'
  | 'right-end'

来源

组件样式文档

贡献者