mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 08:19:15 +08:00
feat: 限制文件最大上传个数 (#3867)
This commit is contained in:
parent
e6a43d22c8
commit
5bf121b687
@ -42,7 +42,7 @@
|
||||
:show-file-list="false"
|
||||
multiple
|
||||
v-model:file-list="uploaderFiles"
|
||||
:limit="10"
|
||||
:limit="1000"
|
||||
>
|
||||
<template #tip>
|
||||
<el-text>{{ uploadHelper }}</el-text>
|
||||
@ -70,6 +70,7 @@
|
||||
type="primary"
|
||||
link
|
||||
@click="removeFile(index)"
|
||||
:disabled="loading"
|
||||
:icon="Close"
|
||||
></el-button>
|
||||
</span>
|
||||
@ -254,12 +255,9 @@ const clearFiles = () => {
|
||||
uploadRef.value!.clearFiles();
|
||||
};
|
||||
|
||||
const handleExceed: UploadProps['onExceed'] = (files) => {
|
||||
const handleExceed: UploadProps['onExceed'] = () => {
|
||||
uploadRef.value!.clearFiles();
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = files[i] as UploadRawFile;
|
||||
uploadRef.value!.handleStart(file);
|
||||
}
|
||||
MsgWarning(i18n.global.t('file.uploadOverLimit'));
|
||||
};
|
||||
|
||||
const hadleSuccess: UploadProps['onSuccess'] = (res, file) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user