导出TXT文件

exportReport (index, row) {
      exportFile({
        tableId: row.id
      })
        .then(res => {
          let url = window.URL.createObjectURL(new Blob([res.data.data]))
          let link = document.createElement('a')
          link.style.display = 'none'
          link.href = url
          // 获取文件名
          // download 属性定义了下载链接的地址而不是跳转路径
          link.setAttribute('download', 'aaa')
          console.log(res)
          document.body.appendChild(link)
          link.click()
        })
 }

导出生成TXT文件

你可能感兴趣的:(导出TXT文件)