I am doing VueJS 3 project with Vuex to deel with the data. For the moment I read my data on a JSON file.
import axios from 'axios'
import { createStore } from 'vuex'
export default createStore({
state: {
data: [],
},
actions: {
getData({commit}){
axios.get('http://localhost:8080/data/mock.json')
.then(res => {
commit('SET_DATA', res.data)
})
},
},
mutations: {
SET_DATA(state, data){
state.data = data.data;
},
},
modules: {
}
})
I would like to do the same thing but with an XML file, not a JSON. Do you know if it's possible ? With axios for example. Thanks