最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
解决iview多表头动态更改列元素发生的错误的方法
时间:2022-06-25 15:30:15 编辑:袖梨 来源:一聚教程网
解决iview 'You may have an infinite update loop in watcher with expression "columns"'
解决方案
单表头是可以动态变化不需要增添什么东西
多表头目前iview尚不能动态变化,会报错You may have an infinite update loop in watcher with expression "columns"
解决方法是github大神提供的:需要修改iview.js源码
将iview.js中
columns: { handler: function handler() { var colsWithId = this.makeColumnsId(this.columns); his.allColumns = (0, _util.getAllColumns)(colsWithId); this.cloneColumns = this.makeColumns(colsWithId); this.columnRows = this.makeColumnRows(false, colsWithId); this.leftFixedColumnRows = this.makeColumnRows('left', colsWithId); this.rightFixedColumnRows = this.makeColumnRows('right', colsWithId); this.rebuildData = this.makeDataWithSortAndFilter(); this.handleResize(); }, deep: true },
修改为
columns: { handler: function handler() { //[Fix Bug]You may have an infinite update loop in watcher with expression "columns" var tempClonedColumns = (0, _assist.deepCopy)(this.columns); var colsWithId = this.makeColumnsId(tempClonedColumns); //[Fix Bug End] this.allColumns = (0, _util.getAllColumns)(colsWithId); this.cloneColumns = this.makeColumns(colsWithId); this.columnRows = this.makeColumnRows(false, colsWithId); this.leftFixedColumnRows = this.makeColumnRows('left', colsWithId); this.rightFixedColumnRows = this.makeColumnRows('right', colsWithId); this.rebuildData = this.makeDataWithSortAndFilter(); this.handleResize(); }, deep: true },
demo
单表头:多表头:
相关文章
- 逆水寒手游流派首席竞选怎么玩 11-07
- 宝可梦大集结新手宝可梦怎么选 11-07
- 光遇11.7每日任务怎么做 11-07
- 英雄联盟双城之战2主题曲怎么样 11-07
- 《怪物猎人荒野》锁头机制介绍 11-07
- 逆水寒手游流派首席竞选怎么玩 逆水寒手游流派首席竞选玩法介绍 11-07