feat(input): Allow to set "required" attribute

Fixes #163
This commit is contained in:
Nguyễn Hồng Quân
2023-07-03 17:29:11 +07:00
parent ae2eaf1bd4
commit c4627e4af2
3 changed files with 29 additions and 3 deletions

View File

@@ -10,6 +10,7 @@
v-model="model"
:disabled="disabled"
:type="type"
:required='required'
:class="[inputClasses, $slots.prefix ? 'pl-10' : '']"
/>
@@ -33,6 +34,7 @@ interface InputProps {
disabled?: boolean;
type?: 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week';
size?: InputSize;
required?: boolean;
modelValue: string;
}
@@ -41,6 +43,7 @@ const props = withDefaults(defineProps<InputProps>(), {
disabled: false,
type: 'text',
size: 'md',
required: false,
modelValue: '',
})