fix(Sku): duplicate pictures in image preview (#6610)

This commit is contained in:
neverland 2020-06-25 16:51:21 +08:00 committed by GitHub
parent ca0c7c236d
commit 4230011480
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -267,9 +267,10 @@ export default createComponent({
}
treeItem.v.forEach((vItem) => {
const img = vItem.previewImgUrl || vItem.imgUrl || vItem.img_url;
if (img) {
imageList.push(img);
const imgUrl = vItem.previewImgUrl || vItem.imgUrl || vItem.img_url;
if (imgUrl && imageList.indexOf(imgUrl) === -1) {
imageList.push(imgUrl);
}
});
});