diff --git a/src/utils/download.js b/src/utils/download.js index aba2d53..05324f4 100644 --- a/src/utils/download.js +++ b/src/utils/download.js @@ -24,3 +24,16 @@ export const downloadFileByUrl = (url) => { URL.revokeObjectURL(link.href) document.body.removeChild(link) } + +// pdf、doc、docx等文件下载 +export const downloadFileData = ({ fileName, fileUrl }) => { + const link = document.createElement('a') + link.setAttribute('download', '') + link.style.display = 'none' + link.href = fileUrl + link.download = fileName + document.body.appendChild(link) + link.click(); + // URL.revokeObjectURL(link.href) + document.body.removeChild(link) +} \ No newline at end of file diff --git a/src/views/base/bracelet/index.vue b/src/views/base/bracelet/index.vue index aa8f30e..2ea0072 100644 --- a/src/views/base/bracelet/index.vue +++ b/src/views/base/bracelet/index.vue @@ -87,8 +87,8 @@ - - + + - + - +