Error: [vuex] do not mutate vuex Table Component
See original GitHub issueWindows 10 Fire Fox Developer Edition Bootstrap-Vue v2.0.0-rc.11
When we use the component Table with Row details support with Vuex strict, this error is showed:
Error in callback for watcher "function () { return this._data.$$state }": "Error: [vuex] do not mutate vuex store state outside mutation handlers."
To see this error in console, just click in detail button, using a vuex data by getters in :items of b-table.
Have one fix or workaround for this? Thanks.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top Results From Across the Web
vue.js - "Error: [vuex] do not mutate vuex store state outside ...
It is because you are mutating vuex state outside a mutation . In your store either move the mutating part in a mutation...
Read more >Error: form binding with Vuex - Do not mutate vuex store state ...
The problem I'm seeing is that as soon as the a bound form field changes, it triggers the error: Do not mutate vuex...
Read more >do not mutate vuex store state outside mutation handlers-Vue.js
Coding example for the question vuex error - do not mutate vuex store state outside mutation handlers-Vue.js.
Read more >[vuex] do not mutate vuex store state outside mutation handlers.
I'm using a q-table to display some data in a table. The data is ... Error: [vuex] do not mutate vuex store state...
Read more >Vuex - Do not mutate vuex store state outside mutation handlers
You call await this.treeRecord(); in your mounted lifecycle hook, which attributes the state reference to this.data . Then you call this.getTreeSpouse(); which ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This happens because the table component is trying to update the Vuex state directly, which is not allowed in strict mode. You would have to use a mutation:
https://jsfiddle.net/t1fzL5s6/
It’s not a workaround though, it’s how vue works. A property needs to be defined in order to be reactive. This is already mentioned in the docs.