What problem does this feature solve?
Problem:
- I have an Upload component that has a defaultFileList of images.
- Some of the images have a broken link and the thumbnail being rendered is the default HTML broken image with the alt text. Not very visually pleasing.
- I'd like to render a fallback image instead.
- I'm aware I can use renderItem to handle this but then I would be unable to use the default AntD component listing the files. I would have to create my own component.
What does the proposed API look like?
<Upload
defaultFileList={[
{
fallback: "public/images/fallback.svg",
uid: "0",
status: "done",
name: "filename.svg",
url: "https://***.com/images/filename.svg",
},
]
}
</Upload>
<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
1条答案
按热度按时间7bsow1i61#
file 里的 fallback 不是 antd 控制的,是上传的文件属性。可以加个 components 来实现