Skip to main content
The InputDate.vue component is a reusable Vue.js component for selecting and displaying date inputs. It supports features such as read-only and disabled states, as well as seamless integration with v-model for two-way data binding.

Features

Date Input

Provides a native HTML date input element for selecting dates.

Custom Labels

Displays a label alongside the input for improved user experience.

Read-Only and Disabled States

Supports states to control user interaction.

Usage

Basic Example

Disabled Input

Read-Only Input


Props

string
default:"undefined"
The value bound to the date input field.
number | string
default:"100"
The width of the component as a percentage.
string
default:"''"
The label displayed alongside the date input field.
string
default:"null"
Error message to display for validation errors (if any).

Example Use Cases

Reactive Date Input

Bind the date value reactively with v-model:

Notes

  • The model prop supports various formats for date values, including strings and numbers, for flexible integration with different data models.
  • The error prop can be used to highlight validation issues by applying a corresponding error state to the input field.
  • The label prop allows you to provide descriptive text for the date input, enhancing usability and accessibility.
For further customization, refer to the component’s source code.