Answer the question
In order to leave comments, you need to log in
How to dynamically access a property of a component's data object?
Tell me how you can access the component's data object, not directly, through this.varValueFirst, but dynamically, by converting the string into the name of this variable?
export default {
data() {
return {
dynamicVarName: 'varValueFirst',
varValueFirst: 'Значние1',
varValueSecond: 'Значние2'
}
},
methods: {
// Т.е. я хочу получить значение this.varValueFirst, но через значение переменной this.dynamicVarName
console.log(.....)
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question