最新下载
热门教程
- 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中
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
单表头:多表头:
相关文章
- 空洞骑士丝之歌存档怎么保存 手动备份与云存档方法介绍 09-10
- 原神挪德卡莱兑换码是什么 挪德卡莱限时最新兑换码大全 09-10
- 空洞骑士丝之歌XGP与Steam存档互通吗 双平台存档转换方法介绍 09-10
- 空洞骑士丝之歌MOD怎么安装 MOD安装步骤指南 09-10
- 禁闭求生2怎么做泥土弹 泥土弹制作方法 09-10
- 禁闭求生2碎石弹药怎么做 碎石弹药制作攻略 09-10