In my Vue app, I get a XML file with Axios and use parseString to parse XML as JSON. I then need to pass the result
to Vue data (this.events). My console log shows
Answer above is correct. However, I would just use arrow functions everywhere so the this
is always the VUE class component. Also, I would check for parsing errors.
axios.get('http://url.to/events.xml')
.then(response => {
parseString(response.data, (err, result) => {
if(err) {
//Do something
} else {
this.events = result
}
});
})
}