首页 > 解决方案 > 如何显示使用`axios.get`下载的图像

问题描述

我想 axios.get 一个 png 并将其显示在 reactjs 的图像元素中。我已经尝试将 response.data 放入 URL.createObjectURL 但这给了我一个错误 Unhandled Rejection (TypeError): URL.createObjectURL: Argument 1 is not valid for any of the 1-argument overloads.

标签: reactjsimagehttpaxiosget

解决方案


推荐阅读