diff --git a/src/runtime/components/RadioGroup.vue b/src/runtime/components/RadioGroup.vue index 039575a6..8877fd50 100644 --- a/src/runtime/components/RadioGroup.vue +++ b/src/runtime/components/RadioGroup.vue @@ -24,6 +24,11 @@ export interface RadioGroupProps extends Pick>(), { + valueKey: 'value' as any, orientation: 'vertical' }) const emits = defineEmits() @@ -84,14 +90,20 @@ function normalizeItem(item: any) { } } + const value = item[props.valueKey] + return { ...item, - id: `${id}:${item.value}` + value, + id: `${id}:${value}` } } const normalizedItems = computed(() => { - if (!props.items) return [] + if (!props.items) { + return [] + } + return props.items.map(normalizeItem) })