8/1 限制前端输入字数
This commit is contained in:
@@ -82,7 +82,8 @@
|
||||
v-model:file-list="fileList"
|
||||
:action="uploadUrl"
|
||||
list-type="picture-card"
|
||||
:limit="1"
|
||||
:limit="9"
|
||||
:on-exceed="handleExceed"
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:on-remove="handleRemove"
|
||||
:before-upload="handleChangeFile"
|
||||
@@ -213,6 +214,9 @@ const handleChangeFile: UploadProps['beforeUpload'] = (rawFile: UploadRawFile) =
|
||||
return true;
|
||||
};
|
||||
|
||||
const handleExceed: UploadProps['onExceed'] = () => {
|
||||
ElMessage.warning(`最多只能上传 9 个文件`);
|
||||
};
|
||||
const handlePictureCardPreview: UploadProps['onPreview'] = (uploadFile) => {
|
||||
dialogImageUrl.value = uploadFile.url!;
|
||||
dialogVisible.value = true;
|
||||
|
||||
Reference in New Issue
Block a user