this.json_data = res.data.records;
<download-excel style="display: inline;margin-left: 10px" :data = "json_data" :fields = "json_fields" name = "***.xls">
<el-button type="primary">导出</el-button>
</download-excel>
json_fields: {
"名称": "***",
"名称": "***",
"名称": "***",
"名称": {
field: "***",
callback: value => {
if(value=='***'){
return '***';
}else if(value=='***') {
return '***';';
}else{
return ''
}
}
},
"名称": {
field: "state",
callback: value => {
if(value==1){
return '***';';
}else if(value==2) {
return '***';';
}else{
return ''
}
}
},
"名称": {
field: "createTime",
callback: value => {
return this.formatTimes(value);
}
}
},
json_data: [],
json_meta: [
[
{
" key ": " charset ",
" value ": " utf- 8 "
}
]
]
vue导出操作
最新推荐文章于 2022-11-22 10:36:00 发布