【vue】后端接口返回了在预览中展示的png(二进制流)如何展示在前端页面?
代码
created() { axios({ url: "http://localhost:8080/img/getimg", responseType: "blob", //关键 }).then((res) => { let data = new Blob([res.data]); let url = window.URL.createObjectURL(data); this.image = url; //image是图片的路径 }); },
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决