I am facing an issue where the console log shows me the updated array xyz
, but when I try to print it in the DOM using {{xyz}}
, it does not update. Can anyone shed some light on why this might be happening?
data() {
return {
xyz: []
}
},
methods: {
getDataFromXML() {
Array.prototype.forEach.call(this.allxml, path => {
fs.readFile(xmlLoc, (err, data) => {
if (err) throw err;
var XmlNode = new DOMParser().parseFromString(data.toString(), 'text/xml')
this.$set(this.xyz,path,XmlNode)
})
})
console.log(this.xyz)
}
}