ฉันพยายามที่จะแสดงของฉันรูปกับ itemDate.js แฟ้ม:
const itemData = [
{
img: "../assets/photos/photoportrait.jpeg",
title: 'Breakfast',
},
แล้วโทรมาด้วยการชุดผลงานของฉันส่วนประกอบ:
import * as React from 'react';
import ImageList from '@mui/material/ImageList';
import ImageListItem from '@mui/material/ImageListItem';
import itemData from './itemData';
function Portfolio() {
return(
<ImageList sx={{ width: 500, height: 450 }} cols={3} rowHeight={164}>
{itemData.map((item) => (
<ImageListItem key={item.img}>
<img
src={item.img}
srcSet={item.img}
alt={item.title}
loading="lazy"
/>
</ImageListItem>
))}
</ImageList>
ไม่มีข้อผิดพลาดข้อความเส้นทางที่ถูกต้องแต่ไม่มีอะไรปรากฎบนหน้าของฉัน. มันทำงานกับเชื่อมโยงแต่ไม่ได้ทำงานกับท้องถิ่นเส้นทางเดินของตัวเอง รู้บ้างมั้ย?
ขอบคุณ