Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to update item of deep array in mutation #1694

Closed
enjkvbej opened this issue Mar 11, 2020 · 1 comment
Closed

How to update item of deep array in mutation #1694

enjkvbej opened this issue Mar 11, 2020 · 1 comment

Comments

@enjkvbej
Copy link

state = {
  list: [
      {
          config: {
              children: []
          },
      },
  ]
}

mutation:
const copyRow = cloneDeep(state.list[0]) // lodash cloneDeep
copyRow.config.children.push({xxx: xxx})
state.list.splice(0, 1, copyRow)

expect: add item in chlidren
error: [vuex] do not mutate vuex store state outside mutation handlers.
Please help me! Thanks!

@vue-bot
Copy link

vue-bot commented Mar 11, 2020

Hello, thank you for taking time filling this issue!

However, we kindly ask you to use our Issue Helper when creating new issues, in order to ensure every issue provides the necessary information for us to investigate. This explains why your issue has been automatically closed by me (your robot friend!).

I hope to see your helper-created issue very soon!

@vue-bot vue-bot closed this as completed Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants