I don't know if this is a logical question, however, I have a weird issue or say a weird requirement. I need to access the value of a dynamically generated variable.
data:{
brand: undefined,
model: undefined
}
methods:{
check(){
let fields = ['brand', 'model'];
for(let i in fields){
console.log(`this.${fields[i]}`) // I need this to access the field values
}
}
}
this[fields[i]].for...of, if it makes things a bit more readable/understandable