formatter 用来格式化内容 Function(row, column, cellValue, index)
需求:获取的数据中没有的项用0表示,不要空着
在每列单元格标签内加上:formatter=“columnFormatter”,当然如果不同的需求可以添加不同的formatter方法,这里的需求只用变成0就行,所有我在每个需要变成0的项添加了相同的formatter方法,
columnFormatter(row, column,cellValue, index){//这些参数不用的可以不写
let a = cellValue;
if(a == undefined){
a = 0;
cellValue = a;
}
return cellValue;
}
formatter
最新推荐文章于 2023-05-19 17:43:17 发布