Skip to content

Commit 4cb0638

Browse files
hywaxvercel[bot]benjamincanac
authored
fix(RadioGroup): update update:modelValue emit type (#5349)
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com> Co-authored-by: Benjamin Canac <canacb1@gmail.com>
1 parent 65e063f commit 4cb0638

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/runtime/components/RadioGroup.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import type { RadioGroupRootProps, RadioGroupRootEmits } from 'reka-ui'
33
import type { AppConfig } from '@nuxt/schema'
44
import theme from '#build/ui/radio-group'
5-
import type { AcceptableValue, GetItemKeys, GetModelValue } from '../types/utils'
5+
import type { AcceptableValue, GetItemKeys, GetModelValue, GetModelValueEmits } from '../types/utils'
66
import type { ComponentConfig } from '../types/tv'
77
88
type RadioGroup = ComponentConfig<typeof theme, AppConfig, 'radioGroup'>
@@ -71,9 +71,9 @@ export interface RadioGroupProps<T extends RadioGroupItem[] = RadioGroupItem[],
7171
ui?: RadioGroup['slots']
7272
}
7373
74-
export type RadioGroupEmits = RadioGroupRootEmits & {
74+
export type RadioGroupEmits<T extends RadioGroupItem[] = RadioGroupItem[], VK extends GetItemKeys<T> = 'value'> = Omit<RadioGroupRootEmits, 'update:modelValue'> & {
7575
change: [event: Event]
76-
}
76+
} & GetModelValueEmits<T, VK, false>
7777
7878
type NormalizeItem<T extends RadioGroupItem> = Exclude<T & { id: string }, RadioGroupValue>
7979
@@ -101,7 +101,7 @@ const props = withDefaults(defineProps<RadioGroupProps<T, VK>>(), {
101101
descriptionKey: 'description',
102102
orientation: 'vertical'
103103
})
104-
const emits = defineEmits<RadioGroupEmits>()
104+
const emits = defineEmits<RadioGroupEmits<T, VK>>()
105105
const slots = defineSlots<RadioGroupSlots<T>>()
106106
107107
const appConfig = useAppConfig() as RadioGroup['AppConfig']

0 commit comments

Comments
 (0)