Having trouble extracting data from a parsed XML
to JSON
. I can't seem to figure out how to get the data properly displayed on my screen. Can someone guide me on the right approach?
Here is the Formatted JSON Data:
{
"event":[
{
"name":"Queen",
"date":"2019-09-12",
"genre":"rock",
"time":"20:00:00",
},
{
"name":"2Pac",
"date":"2019-09-25",
"genre":"rap",
"time":"20:00:00"
},
data () {
return {
result: null
}
},
created () {
this.getConcertData()
},
methods: {
getConcertData () {
const parseString = require('xml2js').parseString
this.$axios.get('members.php?xml')
.then((response) => {
const self = this
parseString(response.data, function (err, result) {
self.events = result
console.log(result)
})
})
}
}