下载附件时防止连点

如果是button 直接加loading就能搞定 <el-button type="text" :loading="downLoading" @click="downloadFn(item)">下载</el-button>   如果是标签要加一个判断事件 <span v-loading="downLoading" class="downText" @click="downloadFn(item)">下载</span>   // 下载     async downloadFn(file) {       if (this.downLoading === false) {         this.downLoading = true         const res = await downloadFileByUniq(file.url)         this.downLoading = false         const blob = new Blob([res], { type: '' })         const downloadElement = document.createElement('a')         const href = window.URL.createObjectURL(blob)         downloadElement.href = href         downloadElement.download = this.$dayJs().format('YYYY-MM-DD HH:mm:ss') + file.name         document.body.appendChild(downloadElement)         downloadElement.click()         document.body.removeChild(downloadElement)         window.URL.revokeObjectURL(href)       }     },
上一篇:PCL函数库摘要——3D点云特征描述与提取


下一篇:下载(导出),返回为bytes的字节流,先将bytes转换为blob,再下载