Files
hoppscotch/packages/hoppscotch-app/components/smart/Radio.vue
2022-05-19 13:41:05 +05:30

32 lines
527 B
Vue

<template>
<SmartItem
:label="label"
:icon="selected ? 'radio_button_checked' : 'radio_button_unchecked'"
:active="selected"
role="radio"
:aria-checked="selected"
@click.native="emit('change', value)"
/>
</template>
<script setup lang="ts">
const emit = defineEmits<{
(e: "change", value: string): void
}>()
defineProps({
value: {
type: String,
default: "",
},
label: {
type: String,
default: "",
},
selected: {
type: Boolean,
default: false,
},
})
</script>