Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders

出现错误的原因在于:

父组件通过props传值给子组件,子组件改变props的属性值报错问题

props:['projects','num','project', 'cur_type','customer_id', 'user_id']
改变了projects
// this.projects = this.projects.filter(item => {//     return item.id !== this.project// })

父子组件中的数据流是单向的, 同时也给出了子组件操作数据时的解决方法。

computed:{filter_project(){return this.projects.filter(item => {return item.id !== this.project})},}

可以通过计算属性的方式实现对数据的修改。

Avoid mutating a prop directly since the value will be overwritten whenever相关推荐

  1. Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-

    原因: 子组件改了父组件的值 避免修改父组件传过来的值 注意: 如果value是obj,需要进行深拷贝. 可以参考: https://blog.csdn.net/u013948858/article/ ...

  2. [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever...

    报错 [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the paren ...

  3. vue使用prop通信出错:Avoid mutating a prop directly since the value will be overwritten whenever the parent

    使用props进行父子组件通信时产生错误:Avoid mutating a prop directly since the value will be overwritten whenever the ...

  4. vue 报错avoid mutating a prop directly since the value will be overwritten whenever

    这里写自定义目录标题 avoid mutating a prop directly since the value will be overwritten whenever 子组件修改父组件值时报的错 ...

  5. 报错信息:Avoid mutating a prop directly since the value will be overwritten

    报错信息:Avoid mutating a prop directly since the value will be overwritten whenever the parent componen ...

  6. avoid mutating a prop directly since the value will be overwritten whenever完美解决

    在vue父组件传递数据给子组件时候,通过双向绑定给属性赋值时候,报错如下:Avoid mutating a prop directly since the value will be overwrit ...

  7. Avoid mutating a prop directly since the value will be overwritten whenever the parent ...

    错误:[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the paren ...

  8. 【VUE】异常解决:Avoid mutating a prop directly since the value will be overwritten

    author: date: 2021.07.03 文章目录 1. 需求及报错 2. 分析原因 2.1 这是什么原因造成? 3. 解决方案: 使用 v-on 明确实现修改方式 4. 参考 1. 需求及报 ...

  9. 【VUE】异常解决:Avoid mutating a prop directly since the value will be overwritten ...

    author: jwensh date: 2021.07.03 文章目录 1. 需求及报错 2. 分析原因 2.1 这是什么原因造成? 3. 解决方案: 使用 v-on 明确实现修改方式 4. 参考 ...

最新文章

  1. python beautifulsoup抓取网页内容_利用Python和Beautiful Soup抓取网页内容
  2. Asp.Net分页控件
  3. 如何判断自己是否到了该辞职的时候
  4. 【IDEA】IDEA 设置 字体 可以滚轮 改变大小
  5. java中程序跳转_java程序中先后台交互的两种实现方式以及页面之间的跳转
  6. java 方法的返回值(翻译自Java Tutorials)
  7. 同一张表sql省市区三级联动查询
  8. pytorchOCR之CRNN
  9. html5年龄大于18岁,写个JavaScript函数来判断是否大于18岁,比如传入1
  10. 如何在CentOS 7上安装Yarn
  11. 计算机组装方案背景图,白色系主机的另外一种搭配:联力O11MINI装机作业参考...
  12. linux轻量级进程,linux轻量级进程LWP
  13. 微信支付的软件架构究竟有多牛逼...
  14. 清平调-邓丽君歌曲(非王菲或混合)简介及下载
  15. man帮助手册中英文设置
  16. Python项目之企业审批流绩效分析分析应用2
  17. 三年成为年薪70w架构师,只因做到了这些。果然不是一般人
  18. Pointcut注解表达式@target、@annotation、@within、this、target、within等
  19. OpenSIPS-NAT穿越,SIP注册,INVITE及RTPProxy配置
  20. 怎么把pdf转换成txt

热门文章

  1. 香港理工大学王淑君老师课题组招收全奖博士生/实习生
  2. 桌面上的ie,小游戏,极品美媚图,免费新电影,淘宝网今日打折特价区的图标无法删除,怎么办?
  3. 用kNN算法诊断乳腺癌--基于R语言
  4. 同时买票是怎么实现的_候补购票和抢票有什么不同 候补购票和抢票能同时进行吗...
  5. 轻松解决 f2pool鱼池ethermine连接失败antpool矿池连接不上的问题E池连接超时
  6. 递四方(4PX)一面
  7. 常见竖屏设备屏幕宽高比
  8. 使用概率法计算圆周率
  9. 使用openSSL制作SSL证书
  10. 华为设备常用软件包名