Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

  <Upload
    listType="picture-card"
    onPreview={this.onPreview}
    onDownload={this.onDownload}
    showUploadList={{ showDownloadIcon: true }}
    name="files"
    action="http://localhost:4000/upload.do"
  />

如下图,不管是图片还是文件,都显示了一个预览按钮,但是第二个非图片的文件,我不想他显示预览按钮showUploadList中的showDownloadIcon只能全部控制,这并不是我想要的,怎么办?

image.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
311 views
Welcome To Ask or Share your Answers For Others

1 Answer

https://codesandbox.io/s/t4pow

请看官方例子

image.png

非图片文件虽然有预览按钮, 但是不能点击, 你可以调整css让他不显示


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...