码上敲享录 > vue.js常见问题详解 > [Vue warn]: You may have an infinite update loop in a component render function.

[Vue warn]: You may have an infinite update loop in a component render function.

上一章章节目录下一章 2020-10-20已有1238人阅读 评论(0)

[Vue warn]: You may have an infinite update loop in a component render function.


解决方法:

以下循环数组,修改对象属性导致上述错误

array.forEach(function(opt){

          opt.content=opt.content+"追加内容"

 })


我改成这样就可以了:

array.forEach(function(opt){

   var oldOpt=Object.assign({}, opt)

   oldOpt.content=oldOpt.content+"追加内容"

 })


向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti
0

有建议,请留言!

  • *您的姓名:

  • *所在城市:

  • *您的联系电话:

    *您的QQ:

  • 咨询问题:

  • 提 交