We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
比如我定义了一个userModel和otherModel。 在userModel内部state为一个对象{}。 mutations获取参数,当前的state和传递过来的payload。 此时我想改变state这个对象,不能直接去改变参数里面的state。 必须循环一个个遍历state对象的值,payload有相同字段的则覆盖,不同的则添加。
const userModule = { state: { username: '', token: '' }, mutations: { updateUser: (state, payload) => { // ... } } }
The text was updated successfully, but these errors were encountered:
这并不是什么bug,是vuex里就这样做的吧
Sorry, something went wrong.
No branches or pull requests
比如我定义了一个userModel和otherModel。
在userModel内部state为一个对象{}。
mutations获取参数,当前的state和传递过来的payload。
此时我想改变state这个对象,不能直接去改变参数里面的state。
必须循环一个个遍历state对象的值,payload有相同字段的则覆盖,不同的则添加。
The text was updated successfully, but these errors were encountered: