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

64. v-model 遇到 vuex 为什么会报错 #64

Open
wqjiao opened this issue Jun 19, 2020 · 0 comments
Open

64. v-model 遇到 vuex 为什么会报错 #64

wqjiao opened this issue Jun 19, 2020 · 0 comments

Comments

@wqjiao
Copy link
Owner

wqjiao commented Jun 19, 2020

  • 问题
    在使用 vuex 时,input 中使用 v-model 双向绑定计算属性 computed 中的 message
Computed property "message" was assigned to but it has no setter.
  • 原因
    vuex 在严格模式下,当 v-model 试图直接修改 message,在严格模式中,由于这个修改不是在 mutation 函数中执行的, 这里会抛出一个错误。

  • 解决方案
    vue 官方文档中已经给出了相应的解决方案: vue 表单处理

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

1 participant