0👍
Dumb me, this did the trick:
Fetch:
async fetch ({store}) {
await store.dispatch('getMediaList')
}
Actions:
async getMediaList ({commit}) {
try {
const { data } = await API.get(`/wp/media`)
commit('setMediaList', data)
} catch (error) {
console.log(error)
}
}
- [Vuejs]-Tell Webpack Where to Find Static Assets in Vue Application
- [Vuejs]-Problem accessing the vuex mutations from inside of the store/index.js
Source:stackexchange.com