1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Vuex] getters/mutations/actions は複数形だぞ!

Last updated at Posted at 2020-02-18

複数形

new Vuex.Store({
  state: {},
  mutations: {}, // ← "mutation" ではなく "mutations"
  actions: {},   // ← "action" ではなく "actions"
  getters: {},   // ← "getter" ではなく "getters"
});

単数形だと…

[vuex] unknown action type: xxx

あるいは

[vuex] unknown local action type: xxx, global type: xxx

といったエラーが出ます。

小一時間悩んでしまった…

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?