You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.
exportconstgetters={foo(state){return(range)=>{constresult=Object.assign({},state.bar)result[range].push('test')// raise an errorreturnresult}}
When I call it in my component, I get a Vuex error : [vuex] do not mutate vuex store state outside mutation handlers
It only occurs when I'm mutating the array, if instead of doing a push i assign that property to a value (for example an integer):
result[range]=1
It doesn't raise any error. Also, I can output the result of that getter without any problem, the array end with 'test' and the original array is not modified.
What is expected ?
Nothing, it shouldn't raise any error when I modify an array of a copy of an Object.
What is actually happening?
An error is raised when I add an element to an array of a copy of an Object.
This bug report is available on Nuxt community (#c109)
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Version
2.13
Steps to reproduce
In my store, i've declared getters like this :
When I call it in my component, I get a Vuex error :
[vuex] do not mutate vuex store state outside mutation handlers
It only occurs when I'm mutating the array, if instead of doing a push i assign that property to a value (for example an integer):
It doesn't raise any error. Also, I can output the result of that getter without any problem, the array end with 'test' and the original array is not modified.
What is expected ?
Nothing, it shouldn't raise any error when I modify an array of a copy of an Object.
What is actually happening?
An error is raised when I add an element to an array of a copy of an Object.
The text was updated successfully, but these errors were encountered: