Super simple question but i've never been able to solve it. Say we have some data:
section: {
option1: true,
option2: true
}
and on a button we have:
<button @click="toggle(option1)">
How do I dynamically paste 'option1' arg into something like this:
toggle(opp){
console.log(this.section.opp)
}
Because currently it's literally looking for this.section.opp, and opp doesn't exist in the data.
toggle('option1')andconsole.log(this.section[opp])- just as it always is in javascript :p