我有一个对象数组,每个对象都有一个 imageUrl 属性,但是当我遍历这个数组以显示所有图像时,图像不会被渲染
我遍历数组并将包含图像链接的属性传递给图像 src
const ProjectData = [
{
title: "RestaurantX",
imageUrl: "../assets/images/restaurantpassport.png",
githubUrl: "",
deployUrl: "",
description: "",
tech: []
},
]
{ProjectData.map(project => {
return (
<Work borderColor={changeColor()}>
<img
src={project.imageUrl}
alt={project.title}
/>
<a className="github">
<i className="material-icons">code</i>
</a>
<a className="deploy">
<i className="material-icons">launch</i>
</a>
</Work>
)