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
| Parameter | Description | Type | Options | Default |
|---|---|---|---|---|
| modelValue | Bound value | string | array | — | — |
| range | Whether range mode | boolean | — | false |
| hourOptions | Hour options | number[] | — | [0-23] |
| minuteOptions | Minute options | number[] | — | [0-59] |
Type Definition
typescript
interface SelectTimeProps {
modelValue?: string | string[];
range?: boolean;
hourOptions?: number[];
minuteOptions?: number[];
}