You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
< docs >
-- -
order : 10
title :
zh - CN : 限制数量
en - US : Max Count
-- -
# # zh - CN
通过 ` maxCount ` 限制上传数量 。 当为 ` 1 ` 时 , 始终用最新上传的代替当前 。
# # en - US
Limit files with ` maxCount ` . Will replace current one when ` maxCount ` is ` 1 ` .
< / docs >
< template >
< a -space direction = "vertical" style = "width: 100%" size = "large" >
< a -upload
v -model :file-list ="fileList"
list -type = " picture "
:max-count ="1"
action = "https://www.mocky.io/v2/5cc8019d300000980a055e76"
>
< a -button >
< upload -outlined > < / u p l o a d - o u t l i n e d >
Upload ( Max : 1 )
< / a - b u t t o n >
< / a - u p l o a d >
< a -upload
v -model :file-list ="fileList2"
list -type = " picture "
:max-count ="3"
action = "https://www.mocky.io/v2/5cc8019d300000980a055e76"
>
< a -button >
< upload -outlined > < / u p l o a d - o u t l i n e d >
Upload ( Max : 3 )
< / a - b u t t o n >
< / a - u p l o a d >
< / a - s p a c e >
< / template >
< script lang = "ts" setup >
import { ref } from 'vue' ;
import { UploadOutlined } from '@ant-design/icons-vue' ;
import type { UploadProps } from 'ant-design-vue' ;
const fileList = ref < UploadProps [ ' fileList ' ] > ( [ ] ) ;
const fileList2 = ref < UploadProps [ ' fileList ' ] > ( [ ] ) ;
< / script >