<el-button @click="exportExcel" >
<i style="display: inline-block;">
<img src="@/assets/img/export.png" alt>
</i> 导出
</el-button>
==============》
methods: {
exportExcel () {
console.log(111)
if (this.tableData.length) {
this.exportLoading = true
const params = {
title: ['序号', '所属一级分区', '所属二级分区','时间(月)','供水量','环比上月'],
key: ['category1', 'category2', 'category3','category4','category5'],
data: this.tableData,
autoWidth: true,
filename: '供水量统计'
}
excel.export_array_to_excel(params)
this.exportLoading = false
} else {
this.$Message.info('表格数据不能为空!')
}
}
},

相关文章:

  • 2021-07-25
  • 2021-05-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-04
猜你喜欢
  • 2022-12-23
  • 2021-12-15
  • 2021-07-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案