mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-11 11:32:52 +08:00
docs: update upload-png-only demo (#33544)
[[English Template / 英文模板](https://github.com/ant-design/ant-design/blob/master/.github/PULL_REQUEST_TEMPLATE.md)] ### 🤔 这个变动的性质是? - [ ] 新特性提交 - [ ] 日常 bug 修复 - [ ] 站点、文档改进 - [x] 演示代码改进 - [ ] 组件样式/交互改进 - [ ] TypeScript 定义更新 - [ ] 包体积优化 - [ ] 性能优化 - [ ] 功能增强 - [ ] 国际化改进 - [ ] 重构 - [ ] 代码风格优化 - [ ] 测试用例 - [ ] 分支合并 - [ ] 其他改动(是关于什么的改动?) ### 🔗 相关 Issue 无 ### 💡 需求背景和解决方案 无 ### 📝 更新日志 | 语言 | 更新描述 | | ------- | -------- | | 🇺🇸 英文 | | | 🇨🇳 中文 | | ### ☑️ 请求合并前的自查清单 ⚠️ 请自检并全部**勾选全部选项**。⚠️ - [x] 文档已补充或无须补充 - [x] 代码演示已提供或无须提供 - [x] TypeScript 定义已补充或无须补充 - [x] Changelog 已提供或无须提供
This commit is contained in:
parent
a801933196
commit
a29154e67a
@ -21,10 +21,11 @@ import { UploadOutlined } from '@ant-design/icons';
|
||||
const Uploader = () => {
|
||||
const props = {
|
||||
beforeUpload: file => {
|
||||
if (file.type !== 'image/png') {
|
||||
const isPNG = file.type === 'image/png';
|
||||
if (!isPNG) {
|
||||
message.error(`${file.name} is not a png file`);
|
||||
}
|
||||
return file.type === 'image/png' ? true : Upload.LIST_IGNORE;
|
||||
return isPNG || Upload.LIST_IGNORE;
|
||||
},
|
||||
onChange: info => {
|
||||
console.log(info.fileList);
|
||||
|
Loading…
Reference in New Issue
Block a user