mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 10:12:51 +00:00
feat: 上传限制
This commit is contained in:
parent
4054244f65
commit
1fdbf5de54
|
|
@ -17,6 +17,8 @@
|
|||
:auto-upload="false"
|
||||
:show-file-list="false"
|
||||
accept=".txt, .md"
|
||||
limit="50"
|
||||
:on-exceed="onExceed"
|
||||
>
|
||||
<img src="@/assets/upload-icon.svg" alt="" />
|
||||
<div class="el-upload__text">
|
||||
|
|
@ -77,6 +79,9 @@ function deleteFlie(index: number) {
|
|||
form.value.fileList.splice(index, 1)
|
||||
}
|
||||
|
||||
const onExceed = () => {
|
||||
MsgError('每次最多上传50个文件')
|
||||
}
|
||||
/*
|
||||
表单校验
|
||||
*/
|
||||
|
|
@ -86,6 +91,7 @@ function validate() {
|
|||
return valid
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (documentsFiles.value) {
|
||||
form.value.fileList = documentsFiles.value
|
||||
|
|
|
|||
Loading…
Reference in New Issue