You may have an infinite update loop in a component render function
2017-08-04 17:50
1301 查看
注意直接使用数组的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>
相关文章推荐
- vue中渲染数据可能有一个无限更新循环--You may have an infinite update loop in a component render function.
- 利用Mysql进行update时,出现You have an error in your SQL syntax check the manual that corresponds to your My
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- 异常之You have an error in your SQL syntax
- ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server versio
- 使用hibernate架构执行插入操作时You have an error in your SQL syntax;
- You have an error in your SQL syntax; check the manual that
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax;解决办法
- FAQ(43): com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL sy
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server versio
- You have an error in your SQL syntax
- An issue that you may encounter in the future
- 抛出 异常 You have an error in your SQL syntax...
- com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; che
- 连接数据库报“You have an error in your SQL syntax”异常的解决