最新下载
热门教程
- 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
单表头:多表头:
相关文章
- 污痕圣杯阿瓦隆的陨落强力召唤物推荐 07-04
- 燕云十六声生财之道万事知窦万金位置一览 07-04
- BLCoin(BLB币)的交易量 07-04
- XRP价格动态:加密货币老手将2美元买入XRP比作50美元购入比特币——XRP能否复制BTC的崛起之路? 07-04
- 云顶之弈摇摆灵动阵容搭配推荐 07-04
- 金铲铲之战s14堡垒莫甘娜阵容搭配指南 07-04