axios.get("接口地址", {
responseType: "arraybuffer",
params: 传给后端的数据
})
.then(response => {
return (
"data:image/png;base64," +
btoa(
new Uint8Array(response.data).reduce(
(data, byte) => data + String.fromCharCode(byte),
""
)
)
)
})
.then(data => {
this.imgUrl = data; //赋值给img标签的src属性
})
上一篇
Parallels Desktop 16 完美解决无法联网
Parallels Desktop 16 完美解决无法联网,无法连接USB
2021-06-03
下一篇
声明合并
声明合并
2021-04-24