gpt4 book ai didi

javascript - 如何在 html View 中渲染图像数组?

转载 作者:行者123 更新时间:2023-12-02 22:08:24 28 4
gpt4 key购买 nike

下面有包含图像的字符串列表。如何以 Angular 方式将其显示在页面上?

images: "[
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/340ea5ee01acc37f.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/9b75ea873012234c.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/d12b3a343f16cb28.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/ff80cdc13a9832df.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/c11025d7f461121b.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/bb783cf9a2b1f35b.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/3d68e6affdf43c18.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/0fbd36321cf49f40.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/63ef79df1ffcfef5.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/acc162dea7861b9b.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/e7717c4955e5a81c.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/09938b4f62ca370e.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/697ac4b4514d9d5c.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/e0306175706fe9ce.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/6d09a807ebb7860b.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/10bd1eba8dfe318b.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/cff9e8bd0c7e5ec7.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/722e852d720c3d25.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/dc3e2c5631c8ab48.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/9c0ac971e3a244e0.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/616b292e99049410.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/ae03a8b55273958a.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/748114df7b1ecb21.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/021358e328ecc9dd.jpg",
"https://images.oyoroomscdn.com/uploads/hotel_image/1097/13174c9f54ada03f.jpg"
]"

最佳答案

使用*ngFor[src]在html View 中渲染图像

Stackblitz

<div  *ngFor="let image of images" >
<img [src]='image'/>
</div>

关于javascript - 如何在 html View 中渲染图像数组?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59640796/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com