Improve example with autocomplete buttons

This commit is contained in:
2023-06-28 22:30:11 +02:00
parent 935fd47980
commit dd433ee4b4
5 changed files with 75 additions and 63 deletions

View File

@@ -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')"