Radio.vue 527 B

12345678910111213141516171819202122232425262728293031
  1. <template>
  2. <SmartItem
  3. :label="label"
  4. :icon="selected ? 'radio_button_checked' : 'radio_button_unchecked'"
  5. :active="selected"
  6. role="radio"
  7. :aria-checked="selected"
  8. @click.native="emit('change', value)"
  9. />
  10. </template>
  11. <script setup lang="ts">
  12. const emit = defineEmits<{
  13. (e: "change", value: string): void
  14. }>()
  15. defineProps({
  16. value: {
  17. type: String,
  18. default: "",
  19. },
  20. label: {
  21. type: String,
  22. default: "",
  23. },
  24. selected: {
  25. type: Boolean,
  26. default: false,
  27. },
  28. })
  29. </script>