Skip to content
目录

Time Picker

Pick a time.

Basic

html
<template>
  <dk-time-picker v-model="value" />
</template>

<script setup>
import { ref } from 'vue'

const value = ref('')
</script>
展开

Attributes

NameDescriptionTypeDefault
model-value / v-modelBinding value; when value-format is empty, it binds Date by default; range mode uses an array with length 2string / number / Date / Array''
readonlyCompletely read-onlybooleanfalse
disabledDisable the componentbooleanfalse
editableWhether the input is editablebooleantrue
clearableWhether to show clear buttonbooleantrue
sizeInput sizeenum
placeholderPlaceholder (non-range)string''
start-placeholderPlaceholder for start time (range)string''
end-placeholderPlaceholder for end time (range)string''
is-rangeWhether to select a time rangebooleanfalse
range-separatorRange separatorstring'-'
arrow-controlUse arrow controls (otherwise wheel/spinner)booleanfalse
formatDisplay format in inputstring'HH:mm:ss'
value-formatValue format for binding; empty means binding Datestring''
default-valueDefault time shown when panel opensDate / [Date, Date]
disabled-hoursDisable hours options() => number[]
disabled-minutesDisable minutes options(hour: number) => number[]
disabled-secondsDisable seconds options(hour: number, minute: number) => number[]
popper-classCustom class name for dropdownstring''
popper-styleCustom style for dropdownstring / object''
popper-optionsCustom popper options (reserved)object{}
teleportedWhether to teleport dropdown to bodybooleantrue
placementDropdown placementstring'bottom'
fallback-placementsFallback placementsstring[]['bottom','top','right','left']
tabindexNative input tabindexstring / number0
aria-labelNative input aria-label attributestring''
prefix-iconCustom prefix iconstring'IconClock'
clear-iconCustom clear iconstring'IconShanchu1'
idNative input id attributestring / string[]
nameNative input name attributestring / string[]

Events

NameDescriptionParameters
update:modelValuev-model update(value)
changeTriggered when user confirms the value(value)
focusTriggered when input gets focus(evt: FocusEvent)
blurTriggered when input loses focus(evt: FocusEvent)
clearTriggered when clear icon is clicked-
visible-changeTriggered when dropdown shows/hides(visible: boolean)

Exposes

NameDescription
focusFocus the input
blurBlur the input
handleOpenOpen dropdown panel
handleCloseClose dropdown panel