formilyjs / antd

Formily Ant Design Adaptor
MIT License
51 stars 45 forks source link

保留antd的upload的功能:当上传照片数到达限制后,上传按钮消失。 #9

Closed dayuy closed 1 year ago

dayuy commented 1 year ago

https://github.com/formilyjs/antd/blob/90556abf2680973881e2b43b6943ea08d2f920e6/packages/components/src/upload/index.tsx#L182 这里的 getPlaceholder(props) 默认children能否去掉,来保留原antd功能:upload在上传照片数量达到上限后,上传按钮自动消失(https://ant.design/components/upload-cn

<AntdUpload {...useUploadProps(props)}>
    {props.children || getPlaceholder(props)}
</AntdUpload>

原antd此功能:

<Upload
    action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
    listType="picture-card"
    fileList={fileList}
    onPreview={handlePreview}
    onChange={handleChange}
>
        {fileList.length >= 8 ? null : uploadButton}
</Upload>
github-actions[bot] commented 1 year ago

Hello @dayuy, your issue has been closed because it does not conform to our issue requirements. Please use the Issue Helper to create an issue, thank you! 你好 @dayuy,为了能够进行高效沟通,我们对 issue 有一定的格式要求,你的 issue 因为不符合要求而被自动关闭。你可以通过 issue 助手 来创建 issue 以方便我们定位错误。谢谢配合!