Answer the question
In order to leave comments, you need to log in
Why can't I reach the property?
<div>{{my_data['2018-07-11']}} </div>
Output: { "may": 4, "june": 8, "april": 5 }
This code: <div>{{my_data['2018-07-11']['may']}} </div>
Output 4. But on the console I get an error:
Error in render: "TypeError: Cannot read property 'may' of undefined"
var app = new Vue({
el: '#app',
data: {
my_data: {},
mess: 'hello world'
},
created: async function(){
url = 'http://dlang.ru/test'
const response = await fetch(url);
this.my_data = await response.json();
}
})
Answer the question
In order to leave comments, you need to log in
Because at the time of rendering the template, the data has not yet arrived and the object with the data is empty.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question