[vue warn][Avoid mutating a prop directly since the value will be overwritten xx]
翻译内容:避免直接改变属性,因为当父组件重新呈现时,该值将被覆盖。相反,使用基于属性值的数据或计算属性。
原因:子组件不可以直接修改props中传递过来的数据。
[vue warn][Avoid mutating a prop directly since the value will be overwritten xx]
解决方案:在data中定义一个变量赋值props中的值,然后操作该变量即可。
[vue warn][Avoid mutating a prop directly since the value will be overwritten xx]
补充:
props属性值获取必须在beforeCreate周期之后才能获取到内容。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-18
  • 2021-09-10
  • 2021-12-01
  • 2021-06-26
  • 2021-09-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-21
  • 2021-05-11
  • 2022-12-23
  • 2022-01-20
相关资源
相似解决方案