Answer the question
In order to leave comments, you need to log in
How to refer to an object within an object in Vue?
Hello, please help me understand.
I need to write the text that is typed in textarea
to an object that lies inside another object.
data(){
return {
sections: [
{
name: 'My Question',
active: true,
messages: [
{text: 'Hello, what is dilivery time?'},
{text: 'Hello, what is dilivery?'}
],
},
{ name: 'Messanger', active: false },
{ name: 'Community QA', active: false },
{ name: 'FAQ', active: false }
],
}
},
messages
to another element .methods: {
addMsg: function (msg) {
this.sections.messages.push({text: msg})
return false;
}
}
this.sections.messages
produces undefined.
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