Nuxt.js: How to implement vuex nested module in nuxt store modules mode?

Created on 15 Nov 2017  路  5Comments  路  Source: nuxt/nuxt.js

This question is available on Nuxt.js community (#c1873)

Most helpful comment

Why is there no actions in examples?

All 5 comments

Thanks @clarkdo!
I guess I should explore more.
Closing this.

Why is there no actions in examples?

For actions you need to export an "actions" object (the same as for mutations), and when you want to dispatch the action you need to prefix the name of the action with the namespace of the module.
e.g:
in store/todos :
export const actions = { increment ({ commit }) { commit('increment', 1) } }

in components/todos.js:
dispatch('todos/increment')

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

o-alexandrov picture o-alexandrov  路  3Comments

vadimsg picture vadimsg  路  3Comments

maicong picture maicong  路  3Comments

surmon-china picture surmon-china  路  3Comments

gary149 picture gary149  路  3Comments