element table,表格参数格式化formatter
- formatter :formatter='formatterLoad’
- 例子
formatterLode(row,column){
if(row.fpname.includes(‘label’)){ //判断字符串中是否有label
let json=JSON.parse(row.fpname)
return json.label; //返回中json对象中的label
}else{
return row.fpname //没有label,直接返回fpname
}
} - includes:includes() 方法用于判断字符串是否包含指定的子字符串—返回的是布尔值
- json.stringfy()将对象、数组转换成字符串;
- json.parse()将字符串转成json对象。