You may have an infinite update loop in a component render function
来源:互联网 发布:javascript new关键字 编辑:程序博客网 时间:2024/05/24 04:36
注意直接使用数组的reverse()函数可能会引起循环引用,
reArr(value){ return value.reverse() }
错误信息
[Vue warn]: You may have an infinite update loop in a component render function.
<!DOCTYPE html><html><head> <meta charset="utf-8"> <title></title> //导入Vue.js <script type="text/javascript" src="./vue.js"></script></head><body> <div id="app"> <span>{{msg | reverseStr| appendStr}}</span> <span>{{arr | deleteRepeate|reverseArr}}</span> <span>{{arr | reverseArr}}</span> <span>{{msg}}</span> </div></body></html><script type="text/javascript"> new Vue({ el:"#app", data:{ msg:"我你", arr:[1,2,3,4,5,6,3,4,4,3,2,4,6,7,8,9] }, /* 数组自己的,会报错 reArr(value){ return value.reverse(); }*/ filters:{ //修改后的 reverseStr(value){ return value.split("").reverse().join(''); }, appendStr(value){ return value+"是真的吗?" }, deleteRepeate(value){ var set=new Set(value); return Array.from(set); }, reverseArr(value){ var newArr=[]; for(var i=value.length-1;i>=0;i--){ newArr.push(value[i]) } return newArr; }, sumCount(value){ var sum=0; for(var i of value){ sum+=i; } return sum; } } })</script>
阅读全文
0 0
- You may have an infinite update loop in a component render function
- vue中渲染数据可能有一个无限更新循环--You may have an infinite update loop in a component render function.
- Warning: Each child in an array or iterator should have a unique "key" prop. Check the render ...
- react Warning: Each child in an array or iterator should have a unique "key" prop. Check the render
- Warning: Each child in an array or iterator should have a unique "key" prop. Check the render ...
- just have a click the link,you may get surprise
- An issue that you may encounter in the future
- You have an error in your SQL syntax
- MySql JDBC:You have an error in your SQL syntax;
- You have an error in your SQL syntax的解决方法
- 抛出 异常 You have an error in your SQL syntax...
- You have an error in your SQL syntax;解决方法
- 1064 - You have an error in your SQL syntax问题解决
- You have an error in your SQL syntax;
- You have an error in your SQL syntax
- You have an error in your SQL syntax;
- You have an error in your SQL syntax;
- You have an error in your SQL syntax
- Spring JDBCTemplate事务
- 离散事件模拟-银行管理
- Android音频系统扫盲
- Request caching is not available. Maybe you need to initialize the HystrixRequestContext?
- ORACLE数据库的数据对象-表、约束、视图、索引、序列
- You may have an infinite update loop in a component render function
- IMP导入数据库时报缓冲区长度不够的解决方案
- Git学习笔记(一)
- 图片上传及显示
- kafka基础使用方法(java)
- Docker基础教程(4)进阶命令-1-网络,数据卷等内容
- position 和 display 的取值和各自的意思和用法
- 相机围绕目标旋转
- 停止线程的三种方法