vue中渲染数据可能有一个无限更新循环--You may have an infinite update loop in a component render function.
2017-12-05 17:48
711 查看
今天在在工作中碰到个问题,在此记录下。
今天在接接口数据时发现数据搞反了,于是想着把数据倒叙一下
结果报了个错
找了好久发现问题就在于reverse()这个方法
vue的响应式原理中对于数组的更新检测包含了一组观察数组的编译方法
而我在呈现的数据中调用了reverse()这个方法,这样就会导致无限的更新循环。
解决办法也很简单,可以在vue实例的数据对象赋值之前调用reverse()就可以了
学习笔记,如有不足请多指教!
今天在接接口数据时发现数据搞反了,于是想着把数据倒叙一下
<row-list v-if="dataList.rules" :canSelect="!isClose" :dataList="dataList.rules[0].subLotteryRule[0].subLotteryRule.reverse()" @selectRow="selectRow"></row-list>
结果报了个错
找了好久发现问题就在于reverse()这个方法
vue的响应式原理中对于数组的更新检测包含了一组观察数组的编译方法
push()
pop()
shift()
unshift()
splice()
sort()
reverse()
而我在呈现的数据中调用了reverse()这个方法,这样就会导致无限的更新循环。
解决办法也很简单,可以在vue实例的数据对象赋值之前调用reverse()就可以了
学习笔记,如有不足请多指教!
相关文章推荐
- You may have an infinite update loop in a component render function
- MySQL触发器更新本表数据异常:Can’t update table ‘tbl’ in stored function/trigger because it is already used by s
- 利用Mysql进行update时,出现You have an error in your SQL syntax check the manual that corresponds to your My
- 移动文章分类的sql语句,查询并更新同一个表的方法 You can't specify target table 'news_articles' for update in FROM clause
- [Vue warn]: Failed to mount component: template or render function not defined. (found in root insta
- ssh开发中插入数据时遇到 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right
- Error 1064(42000):you have an error in your sql syntax;一个简单的原因
- MySQL触发器更新本表数据异常:Can't update table 'tbl' in stored function/trigger because it is already used by statement which invoked this
- mysql数据库的You have an error in your SQL syntax问题
- Have you considered making your output() function use variable arguments like printf()? In the examp
- com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax;
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL 完美解决
- There is an internal error in the React performance measurement code.Did not expect componentDidMount timer to start while render timer is still in progress for another instance
- SpringMVC:com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax;
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server versio
- com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- 使用hibernate架构执行插入操作时You have an error in your SQL syntax;
- 创建存储过程错误(已解决):Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server ver
- 【Angular2】You have to be inside an angular-cli project in order to use the generate command