Skip to content

TimePicker 时间选择器

规则

js
{
    type: "TimePicker",
    field: "section_time",
    title: "活动时间",
    value: ''
}
{
    type: "TimePicker",
    field: "section_time",
    title: "活动时间",
    value: ''
}

参考:Ant-design-vue_TimePicker

value :Number | String

Props

参数说明类型默认值
addon选择框底部显示自定义的内容slot | slot-scope
allowClear是否展示清除按钮booleantrue
autoFocus自动获取焦点booleanfalse
clearText清除按钮的提示文案stringclear
defaultOpenValue当 defaultValue/value 不存在时,可以设置面板打开时默认选中的值momentmoment()
disabled禁用全部操作booleanfalse
disabledHours禁止选择部分小时选项function()
disabledMinutes禁止选择部分分钟选项function(selectedHour)
disabledSeconds禁止选择部分秒选项function(selectedHour, selectedMinute)
format展示的时间格式string"HH:mm:ss"
getPopupContainer定义浮层的容器,默认为 body 上新建 divfunction(trigger)
hideDisabledOptions隐藏禁止选择的选项booleanfalse
hourStep小时选项间隔number1
inputReadOnly设置输入框为只读(避免在移动设备上打开虚拟键盘)booleanfalse
minuteStep分钟选项间隔number1
open(.sync)面板是否打开booleanfalse
placeholder没有值的时候显示的内容string"请选择时间"
popupClassName弹出层类名string''
popupStyle弹出层样式对象object-
secondStep秒选项间隔number1
suffixIcon自定义的选择框后缀图标string | VNode | slot-
clearIcon自定义的清除图标string | VNode | slot-
use12Hours使用 12 小时制,为 true 时 format 默认为 h:mm:ss abooleanfalse

Events

事件名称说明回调参数
change时间发生变化的回调function(time: moment, timeString: string): void
openChange面板打开/关闭时的回调(open: boolean): void