1๐
โ
As per looking at the console statement, function setLastUpdate
is calling before the parseData
function.
So, to make the lastUpdate
property available for setLastUpdate
, you need to call those functions asynchronously. You can create a single async function that will call both functions one by one and wait for the first to be executed. For example-
created() {
this.init();
},
methods: {
async init() {
await this.parseData();
await this.setLastUpdate();
},
},
One more thing-
instead of-
this.items[0].items.title = this.lastUpdate;
It should be-
this.items[0].items[0].title = this.lastUpdate;
Because inner items is having an array of objects structure.
๐คNeha Soni
Source:stackexchange.com