InputTime.vue component is a reusable Vue.js component for selecting and displaying time inputs. It supports features like read-only and disabled states, integrates with v-model for two-way data binding, and provides a customizable label for improved usability.
Features
Time Input
Uses a native HTML time input element for selecting times.
Custom Labels
Displays a label next to the time input for better user experience.
Read-Only and Disabled States
Provides flexibility for controlling user interaction.
Usage
Basic Example
Disabled Input
Read-Only Input
Props
The value bound to the time input field.
The width of the component as a percentage.
The label displayed alongside the time input field.
Error message to display for validation errors (if any).
Example Use Cases
Reactive Time Input
Bind the time value reactively usingv-model:
Notes
- The
modelValueprop supports various formats for time values, allowing integration with different data models. - The
labelprop provides descriptive text for the time input, enhancing clarity and accessibility. - The
errorprop can be used to highlight validation issues by applying a corresponding error state to the input field.