Skip to content

SelectTime ​

Brief Introduction ​

The selectTime time picker component is used for users to select a time or time range.
You can use <MYSelect-time></MYSelect-time> or <MYSelect-time /> to implement a time picker.

Basic Usage ​

Use v-model to bind the time value.

Code Demo
:
展开代码

Select Time Range ​

Use the range property to enable time range selection mode.

Code Demo
:
至
:
展开代码

Custom Hour Options ​

Use the hourOptions property to customize the hour options.

Code Demo
:
展开代码

Custom Minute Options ​

Use the minuteOptions property to customize the minute options.

Code Demo
:
展开代码

Combined Usage ​

Finally, combine multiple APIs to create a customized time picker:

Code Demo
:
至
:
展开代码

API Reference ​

Props ​

ParameterDescriptionTypeOptionsDefault
modelValueBound valuestring | array——
rangeWhether range modeboolean—false
hourOptionsHour optionsnumber[]—[0-23]
minuteOptionsMinute optionsnumber[]—[0-59]

Type Definition ​

typescript
interface SelectTimeProps {
  modelValue?: string | string[];
  range?: boolean;
  hourOptions?: number[];
  minuteOptions?: number[];
}

Released under the MIT License.