Skip to content

DateTimePicker 日期时间选择器

DateTimePicker 日期时间选择器用于让用户同时选择日期和时间,结合了日期选择和时间选择的功能,通过选项卡界面提供直观的操作体验。

引入

typescript
import { DateTimePicker } from '@versakit/vue'

使用

loading

API

属性

属性名说明类型默认值
modelValue绑定值,选中的日期时间Date-
min可选择的最小日期时间Date-
max可选择的最大日期时间Date-
disabled是否禁用booleanfalse
readonly是否只读booleanfalse
placeholder占位文本string'选择日期时间'
dateFormat日期格式string-
timeFormat时间格式'12h' | '24h''24h'
firstDayOfWeek一周的第一天,0表示周日,1表示周一0 | 1 | 2 | 3 | 4 | 5 | 60
locale本地化配置,影响月份和星期的显示string系统默认
hourStep小时选择步长number1
minuteStep分钟选择步长number1
secondStep秒选择步长number1
showSeconds是否显示秒选择器booleanfalse
clearable是否可清空booleantrue
unstyled是否禁用默认样式booleanfalse
pt自定义样式配置DateTimePickerPT-

事件

事件名说明回调参数
update:modelValue选中日期时间变化时触发(date: Date | null) => void
change选中日期时间变化时触发(date: Date | null) => void
focus输入框获得焦点时触发(e: FocusEvent) => void
blur输入框失去焦点时触发(e: FocusEvent) => void
clear点击清空按钮时触发() => void

插槽

DateTimePicker 组件暂不提供插槽。