I'm using vue3 with Primevue to develop my app. I want to unselect the radio button of Primevue on click. Is there a way to do it? This is my code for radio button.
<div class="field col-12 md:col-12 lg:col-12">
<template v-for="currency in currencies" :key="currency.id">
<div v-if="v$.currency.$model !== currency.code" class="flex align-items-center mb-2">
<RadioButton v-model="paidInType" :inputId="currency.code" name="payIn" :value="currency.code" />
<label :for="currency.code" class="ml-2">Pay in {{ currency.symbol }}</label>
</div>
</template>
</div>
Radio button isn't meant to be un-selectable.
Please use checkbox or toggle component for your usecase and redesign them to your need.
But if you really need to overwrite default radio button action, then adding @click method to remove the selected value if its equal to the clicked on radio button value.