feat: file name as label when edit
This commit is contained in:
parent
e20d5a4c50
commit
7e5cb46e97
4 changed files with 20 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue