我试图在“细节”部分下面的“图片”对象中提取出各个图片。
好像什么都没印出来。在细节中寻找正确的拉入方式。图像。图像1、2或3。
以下是我目前使用的JSON数据:
{
"books": [
{
"title": "title 1",
"image": "/image1.jpg"
},
{
"title": "title 2",
"image": "/image2.jpg"
}
],
"details": [
{
"author": "book author",
"name": "Book name",
"price": 34.99,
"publisher": "Penguin Books",
"images": [
{
"image1": "/image1.jpg",
"image2": "/image2.jpg",
"image3": "/image3.jpg"
}
]
}
]
}
这里还有我在book组件中进行的json调用:
{staticdata.details.map(detail => (
<Book
book_name={detail.author}
book_price={detail.price}
image={detail.images.image1}
/>
))}