export const state = () => ({
projects: []
})
export const mutations = {
SET(state, items) {
state.projects = items
}
}
export const actions = {
async fetch({ commit, state }) {
const response = await this.$axios.$get('http://localhost:8080/projects')
commit('SET', response)
}
}
export const getters = {
projects: (s) => s.projects
}
Может есть какой-то параметр в nuxt.config.js для этого?
module.exports = {
mode: 'spa',
...
}