reactjs - 如何显示使用`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.
解决方案
推荐阅读
- javascript - 我遇到了这个错误:当我命令“npm start”时找不到模块“webpack-cli/bin/config-yargs”
- minikube - 使用 chectl 在 minikube 上安装 che 时出现错误
- css - 引导卡在悬停时更改边框颜色
- elasticsearch - 创建索引模式的问题
- date - 如何在 openapi v3 / swagger 中指定“年份”字段?
- javascript - 在基于 Django 的电子商务应用程序中处理过滤器的 AJAX 方式在复制粘贴新选项卡中的 url 时不起作用
- php - 如何通过 shell_exec() 获取特定进程的状态?
- docker - Python.h:Amazon Linux Lambda 容器上没有这样的文件或目录
- google-analytics - 我可以多次设置谷歌分析用户ID吗?
- api - 邮递员在 .net 核心的 api 中返回未找到 404