Created
April 6, 2020 17:04
-
-
Save mercs600/0725377170e57ea5ad3debd19d2bf20c to your computer and use it in GitHub Desktop.
nuxt-exercise-6-errors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const actions = { | |
async nuxtServerInit ({ commit }, { $http, error }) { | |
try { | |
const menu = await $http.$gest('api/menus') | |
commit('setMenu', menu) | |
} catch (err) { | |
return error(err) | |
} | |
} | |
} | |
export const state = () => ({ | |
menu: [] | |
}) | |
export const mutations = { | |
setMenu(state, payload) { | |
state.menu = payload | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment