1.HTML部分
<el-button
:loading="loading"
size="mini"
class="filter-item"
type="warning"
icon="el-icon-download"
@click="downloadMethodExcel"
>excel模板下载
</el-button>
2.methods中的方法
/*
**excel导出
*/
downloadMethodExcel() {
this.url = 'api/dataReporting/download'
this.params = {
resourcecode: this.code
}
this.loading = true
download(this.url, this.params).then(res => {
this.loading = false
}).catch(() => {
this.loading