码上敲享录 > vue.js常见问题详解 > Instead, use a data or computed property based on the prop's value. Prop being mutated: "xxx"

Instead, use a data or computed property based on the prop's value. Prop being mutated: "xxx"

上一章章节目录下一章 2020-06-29已有1476人阅读 评论(0)

Instead, use a data or computed property based on the prop's value. Prop being mutated: "xxx"


解决方法:

[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "batchColOptions"


因为prop里面定义的属性都单向绑定,父组件传过来的值,子组件不能更改数据,如果想和父组件通讯可以使用$emit 和 $on,可参考:http://www.yayihouse.com/yayishuwu/chapter/2618


0

有建议,请留言!

  • *您的姓名:

  • *所在城市:

  • *您的联系电话:

    *您的QQ:

  • 咨询问题:

  • 提 交