Skip to content

SelectDate ​

Introduction ​

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

Basic Usage ​

Single date picker.

Code Demo
展开代码

Date Range Selection ​

Use the range prop to enable date range selection mode.

Code Demo
展开代码

Single Month Picker ​

Use the month prop to select only the month.

Code Demo
展开代码

Month Range Picker ​

Use the range prop to enable month range selection mode.

Code Demo
展开代码

Year Picker ​

Use the year prop to select only the year.

Code Demo
展开代码

Year Range Picker ​

Use the range prop to enable year range selection mode.

Code Demo
展开代码

Time Picker ​

Use the time prop to enable time selection.

Code Demo
展开代码

Combined Usage ​

Finally, here's an example combining multiple APIs to implement a date-time range picker:

Code Demo
展开代码

API Reference ​

Props ​

ParameterDescriptionTypeOptionsDefault
modelValueBound valuestring | array——
yearWhether to select yearboolean—false
monthWhether to select monthboolean—false
rangeWhether to select rangeboolean—false
timeWhether to select timeboolean—false
placeholderPlaceholder textstring——

Type Definitions ​

typescript
interface SelectDateProps {
  modelValue?: string | string[];
  year?: boolean;
  month?: boolean;
  range?: boolean;
  time?: boolean;
  placeholder?: string;
}

Released under the MIT License.