I have a button on my template that, when clicked, should check all isActive values.
If any value is found to be true, it should be changed to false.
This is how my Vue script is structured:
data: function() {
return {
rates: {
a: {
x: [40, 60],
isActive: false
},
b: {
x: [66, 76],
isActive: false
},
c: {
x: [76, 108],
isActive: false
}
}
}
},
methods: {
changeToFalse() {
// This method will handle the changes
}
}
And this is what my template code looks like:
<template>
<div>
<button @onclick="changeToFalse()"> Click Me </button>
</div>
</template>
Note: All functionality, including the looping through and changing of values, should be contained within the changeToFalse() method. Thank you! :)