chore(Slider): improve update:modelValue event signature

This commit is contained in:
Benjamin Canac
2024-07-31 11:22:56 +02:00
parent 007a0cf85e
commit 0635c5434c
3 changed files with 6 additions and 5 deletions

View File

@@ -34,9 +34,9 @@ export interface InputProps extends UseComponentIconsProps {
}
export interface InputEmits {
(e: 'update:modelValue', payload: string | number): void
(e: 'blur', event: FocusEvent): void
(e: 'change', event: Event): void
(e: 'update:modelValue', payload: string | number): void
}
export interface InputSlots {

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import { tv, type VariantProps } from 'tailwind-variants'
import type { SliderRootProps, SliderRootEmits } from 'radix-vue'
import type { SliderRootProps } from 'radix-vue'
import type { AppConfig } from '@nuxt/schema'
import _appConfig from '#build/app.config'
import theme from '#build/ui/slider'
@@ -30,8 +30,9 @@ export interface SliderProps extends Pick<SliderRootProps, 'name' | 'disabled' |
ui?: Partial<typeof slider.slots>
}
export type SliderEmits = Omit<SliderRootEmits, 'valueCommit'> & {
change: [payload: Event]
export interface SliderEmits {
(e: 'update:modelValue', payload: number | number[]): void
(e: 'change', payload: Event): void
}
</script>

View File

@@ -32,9 +32,9 @@ export interface TextareaProps {
}
export interface TextareaEmits {
(e: 'update:modelValue', payload: string | number): void
(e: 'blur', event: FocusEvent): void
(e: 'change', event: Event): void
(e: 'update:modelValue', payload: string | number): void
}
export interface TextareaSlots {