Pro 时间选择器

用于选择或输入时刻(不含日期)。需要选日期请使用 DatePicker Pro,需要日期+时刻请使用 DateTimePicker Pro

组件选型

组件适用场景
DatePicker Pro日期、日期范围
DateTimePicker Pro日期 + 时刻
TimePicker Pro(本文档)任意时刻、时刻范围
DatePickerPanel Pro独立日期/时间面板

单点选择

任意时刻

默认滚轮选择时刻;arrow-control 改为箭头步进;面板可显示「此刻」按钮(与 show-now 等相关配置一致)。

默认
此刻:
箭头控制
轻量化

禁用部分时段

通过 disabledHoursdisabledMinutesdisabledSeconds 限制可选范围。

范围选择

时刻范围 is-range

设置 is-range 选择开始与结束时刻,同样支持 arrow-control

-
-

API

Attributes

参数说明类型默认值Version
model-value / v-model绑定值,如果它是数组,长度应该是 2number / string / object''
readonly完全只读booleanfalse
disabled禁用booleanfalse
editable文本框可输入booleantrue
clearable是否显示清除按钮booleantrue
size输入框尺寸enum
placeholder非范围选择时的占位内容string''
start-placeholder范围选择时开始日期的占位内容string
end-placeholder范围选择时结束日期的占位内容string
is-range是否为时间范围选择booleanfalse
arrow-control是否使用箭头进行时间选择booleanfalse
popper-classTimePicker Pro 下拉框的类名string''
teleported是否使用 teleport;为 true 时下拉层挂载到 append-to 指定位置booleantrue
append-to下拉层挂载到哪个 DOM 元素string
range-separator选择范围时的分隔符string'-'
format显示在输入框中的格式string see date formats
default-value可选,选择器打开时默认显示的时间Date / object
value-format可选,绑定值的格式。 不指定则绑定值为 Date 对象string 参考 日期格式
id等价于原生 input id 属性string / object
name等价于原生 input name 属性string''
aria-label a11y等价于原生 input aria-label 属性string
prefix-icon自定义前缀图标;未设置时不显示string / Component''
suffix-icon自定义后缀图标;未设置时默认为时钟图标string / Component''
clear-icon自定义清除图标string / ComponentCircleCloseFilled
disabled-hours禁止选择部分小时选项Function
disabled-minutes禁止选择部分分钟选项Function
disabled-seconds禁止选择部分秒选项Function
automatic-dropdown聚焦时是否自动展开面板booleantrue
manual-input是否启用智能分块手动录入booleantrue
save-on-blur无值时失焦是否写入当前时刻;false 时取消可恢复booleantrue
persistent关闭后是否保留下拉 DOMbooleantrue
popper-style下拉层样式object
placement下拉层位置Placementbottom-start
fallback-placements下拉层备选位置array见 popper 默认
popper-optionspopper.js 配置object{}
trigger-suffix仅点击后缀图标打开面板booleanfalse
tabindex输入框的 tabindexstring / number0
empty-values组件的空值配置 参考 config-providerarray
value-on-clear清空选项的值 参考 config-providerstring / number / boolean / Function
label a11y deprecated等价于原生 input aria-label 属性string
plain朴素的 TimePicker ProbooleanfalseV0.0.8
emit-formatted-valuechange 事件是否附带格式化字符串(第二参数)booleanfalseV0.0.8

事件

事件名说明类型
change用户确认选定的值时触发Function
blur在组件 Input 失去焦点时触发Function
focus在组件 Input 获得焦点时触发Function
clear可清空的模式下用户点击清空按钮时触发Function
visible-change当 TimePicker 的下拉列表出现/消失时触发Function

暴露

名称说明Type
focus使组件获取焦点Function
blur使组件失去焦点Function
handleOpen打开时间选择器弹窗Function
handleClose关闭时间选择器弹窗Function

Copyright 2025 Winning Health 版权所有