fix: fileName2Long

This commit is contained in:
puri-ph4tt 2023-12-13 18:06:46 +07:00
parent e6d33873b0
commit 6cb1a67e4f

View file

@ -67,6 +67,10 @@ function checkFileExist(name: string, except?: string) {
)
}
function checkFileName2Long(name: string, except?: string) {
return Boolean(name.length > 85)
}
async function submitFileForm(
value: {
mode: 'create' | 'edit'
@ -130,8 +134,10 @@ async function submitFileForm(
v-model:category="fileFormData.category"
@reset="() => (fileFormError = {})"
@filechange="
(name: string) =>
(fileFormError.fileExist = checkFileExist(name, fileNameLabel))
(name: string) => {
;(fileFormError.fileExist = checkFileExist(name, fileNameLabel)),
(fileFormError.fileName2Long = checkFileName2Long(name, fileNameLabel))
}
"
@submit="submitFileForm"
/>