mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-12 23:35:38 +08:00
6776bb8916
* docs: update demo * chore: add script * test: fix demo test * docs: convert demos * chore: move script * test: remove react-dom import * chore: update deps * docs: update riddle js * test: fix image test * docs: fix riddle demo
905 B
905 B
order | title | ||||
---|---|---|---|---|---|
10 |
|
zh-CN
通过 maxCount
限制上传数量。当为 1
时,始终用最新上传的代替当前。
en-US
Limit files with maxCount
. Will replace current one when maxCount
is 1
.
import { Upload, Button, Space } from 'antd';
import { UploadOutlined } from '@ant-design/icons';
export default () => (
<Space direction="vertical" style={{ width: '100%' }} size="large">
<Upload
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
listType="picture"
maxCount={1}
>
<Button icon={<UploadOutlined />}>Upload (Max: 1)</Button>
</Upload>
<Upload
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
listType="picture"
maxCount={3}
multiple
>
<Button icon={<UploadOutlined />}>Upload (Max: 3)</Button>
</Upload>
</Space>
);