Looking to translate this vanilla JavaScript code into Vue, here's the original:
const radio = document.querySelector('#radio');
const boton = document.querySelector('#boton');
boton.addEventListener('click', () => {
radio.checked = false;
});
And here is the Vue template version:
<tr v-for="(flt, f) in filterResponse" :key="f">
<td>
<input type="radio"
@change="someMethod()"
:id="f"
:checked="false">
</td>
<button @click="uncheckRadio">Uncheck</button>
The method being used:
methods: {
uncheckRadio(){
//Logic goes here
},
}
I am unsure of how to access the id of the radio input from a method, or if there is another approach. Appreciate any guidance, thank you!