reactjs - 图像未显示在下一个并做出反应?
问题描述
我有从 API 获取的数据,我想用 Next 和 React 显示一个图像,但我看不到图像出现在屏幕上,只是显示图像的 alt。我使用的是 next/image 而不是 HTML img?
这是来自 API 的 imaeUrl 181fc194-ca2c-4f11-8442-4d52c094491f.jpg
,
我添加它来修复路径,但仍然显示图像的 alt
const image = `/${course.imageUrl}`
<Image
src={image}
alt="Picture of the author"
width={500}
height={500}
/>
有什么想法我应该解决这个问题吗?
解决方案
推荐阅读
- javascript - 无法从 redux 存储中存储和检索状态
- java - 定义为 JSON 接口的字段的 JAXB/Moxy 编组
- sql - SQL 获取 svn 修订版
- python - 在python中将dict转换为json时出错
- laravel - 我想重新加载我的侧边栏组件(vue js + laravel)
- bash - 我的 .sh 将配置值视为命令
- docker - 如何将服务名称解析为超级账本作曲家的 docker swarm 模式?
- web-testing - Visual Studio-Web 测试失败并显示消息“在测试上下文中找不到上下文参数'$HIDDEN1.NAP'”并且 Web 测试重定向到登录页面
- python - 如何在python中将列表数据转换为格式化的json
- linux - 无法通过 ssh 的函数调用访问局部变量