![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
葱头的故事
这个作者很懒,什么都没留下…
展开
-
项目中使用静态文件的配置
config.js文件放在static或者public文件中。在项目的index.html中加入。原创 2024-05-17 16:27:59 · 119 阅读 · 0 评论 -
回显接口返回的图片文件,blob转成url
responseType是blob。需要将blob文件转换成url显示。原创 2023-12-05 15:34:24 · 160 阅读 · 0 评论 -
获取接口返回的文件,下载文件
后端处理,请求成功后时,浏览器就会自动下载。responseType是blob。原创 2023-12-05 15:30:54 · 67 阅读 · 0 评论 -
异步获取图片url地址,本地下载图片
handleDownload(row) { const { id, name } = row; getQrCodeUrl(id).then((res) => { const imgUrl = res.data.data let image = new Image() image.setAttribute('crossOrigin', 'anonymous') image.onload = function ()..原创 2022-05-25 13:50:03 · 246 阅读 · 0 评论 -
导出报表,通过window.open
handleExport() { this.$confirm('是否导出渠道活码数据?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { window.open( `/api/marketing/channel/channelExport?${ ...原创 2022-05-25 16:17:17 · 119 阅读 · 0 评论 -
上传文件,form
/** * 上传文件 * * @param {Object} data * @param {File} data.file */export const putFileAttach = (data) => { const {file, attachType, foreignKey, fieldName, tableName} = data; const formData = new FormData(); formData.append("file", file, file.n原创 2022-05-25 16:37:46 · 77 阅读 · 0 评论 -
js 使用a标签下载静态文件
下载文件原创 2022-08-18 15:26:25 · 390 阅读 · 0 评论