Improve example with autocomplete buttons
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
const props = defineProps<{
|
||||
modelValue: string;
|
||||
}>();
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
modelValue: string;
|
||||
disabled?: boolean;
|
||||
name?: string;
|
||||
}>(),
|
||||
{
|
||||
disabled: false,
|
||||
}
|
||||
);
|
||||
|
||||
const emits = defineEmits<{
|
||||
(e: "update:modelValue", value: string): void;
|
||||
@@ -13,6 +20,8 @@ const emits = defineEmits<{
|
||||
<template>
|
||||
<input
|
||||
:value="props.modelValue"
|
||||
:disabled="props.disabled"
|
||||
:name="props.name"
|
||||
@input="emits('update:modelValue', (<HTMLInputElement>$event.target).value)"
|
||||
@blur="emits('blur')"
|
||||
@focus="emits('focus')"
|
||||
|
||||
Reference in New Issue
Block a user