RadioGroup.vue 413 B

12345678910111213141516171819202122
  1. <template>
  2. <div class="flex flex-col">
  3. <SmartRadio
  4. v-for="(radio, index) in radios"
  5. :key="`radio-${index}`"
  6. :value="radio.value"
  7. :label="radio.label"
  8. :selected="selected"
  9. @change="$emit('change', radio.value)"
  10. />
  11. </div>
  12. </template>
  13. <script setup lang="ts">
  14. defineProps<{
  15. radios: Array<{
  16. value: string
  17. label: string
  18. }>
  19. selected: string
  20. }>()
  21. </script>