feat: file name as label when edit

This commit is contained in:
Methapon2001 2023-12-12 17:32:16 +07:00
parent e20d5a4c50
commit 7e5cb46e97
No known key found for this signature in database
GPG key ID: 849924FEF46BD132
4 changed files with 20 additions and 4 deletions

View file

@ -14,6 +14,7 @@ const props = withDefaults(
fileName2Long?: boolean
}
mode: 'create' | 'edit'
fileNameLabel?: string
title?: string
description?: string
keyword?: string[]
@ -146,7 +147,13 @@ const file = ref<File | undefined>()
outlined
v-model="file"
@update:model-value="(v) => $emit('filechange', v.name)"
:label="file?.name ? undefined : 'เลือกไฟล์'"
:label="
mode === 'edit' && fileNameLabel && !file?.name
? fileNameLabel
: file?.name
? undefined
: 'เลือกไฟล์'
"
:error="!!error.fileExist || !!error.fileName2Long"
:error-message="
error.fileExist