I would like to have a property dynamically accessed with a variable.
For example, I have :
data(){
redsection : '',
bluesection : '',
},
methods(){
changeColor(color, val){
this.{color+"section"} = val;
}
}
And what I'm trying to do it have a function in the view:
<button @click="changeColor("blue", "bar")>blue</button>
<button @click="changeColor("red", "bar")>blue</button>