0
0

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エラー

Last updated at Posted at 2020-02-04

Error: [vuex] Do not mutate vuex store state outside mutation handlers

ストリクトモード解除

store/index.js

+ export const strict = false
export const state = () => ({

storeを分割して、フォルダ分けした場合でもindex.jsを見に行くっぽいので

store/index.jsのファイルは残して

export const strict = false

だけ記述する

これだとだめだった

computed: {
	...mapGetters({ requestData: 'usergroup/usergroup'})
},

↓↓↓↓

computed: {
	requestData: {
		get() {
			return this.$store.getters['usergroup/usergroup']
		},
		set(value) {
			console.log(value)
			return
			this.$store.dispatch("usergroup/setValue", value)
		},
	}
},

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?