From 3c8d6cd01dfafed5844c376f52adbdda0c814420 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Tue, 13 May 2025 17:18:06 +0200 Subject: [PATCH] fix(Input/Textarea): handle generic types Resolves nuxt/ui-pro#887 --- src/runtime/components/Input.vue | 14 +++++++------- src/runtime/components/Textarea.vue | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/runtime/components/Input.vue b/src/runtime/components/Input.vue index b91319e3..7840a1f1 100644 --- a/src/runtime/components/Input.vue +++ b/src/runtime/components/Input.vue @@ -4,7 +4,7 @@ import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/input' import type { UseComponentIconsProps } from '../composables/useComponentIcons' import type { AvatarProps } from '../types' -import type { ComponentConfig } from '../types/utils' +import type { AcceptableValue, ComponentConfig } from '../types/utils' type Input = ComponentConfig @@ -42,8 +42,8 @@ export interface InputProps extends UseComponentIconsProps { ui?: Input['slots'] } -export interface InputEmits { - (e: 'update:modelValue', payload: string | number): void +export interface InputEmits { + (e: 'update:modelValue', payload: T): void (e: 'blur', event: FocusEvent): void (e: 'change', event: Event): void } @@ -55,7 +55,7 @@ export interface InputSlots { } - -