forked from verdnatura/salix-front
feat: refs #8388 add hasFile property handling in VnDms component
This commit is contained in:
parent
028477ecbe
commit
2fabff05be
|
@ -50,11 +50,9 @@ const dms = ref({});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
defaultData();
|
defaultData();
|
||||||
if (!$props.formInitialData) {
|
if (!$props.formInitialData)
|
||||||
dms.value.description =
|
dms.value.description =
|
||||||
$props.description ?? t($props.model + 'Description', dms.value);
|
$props.description ?? t($props.model + 'Description', dms.value);
|
||||||
dms.value.hasFile = $props.hasFile;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
function onFileChange(files) {
|
function onFileChange(files) {
|
||||||
dms.value.hasFileAttached = !!files;
|
dms.value.hasFileAttached = !!files;
|
||||||
|
@ -96,6 +94,7 @@ function defaultData() {
|
||||||
if ($props.formInitialData) return (dms.value = $props.formInitialData);
|
if ($props.formInitialData) return (dms.value = $props.formInitialData);
|
||||||
return addDefaultData({
|
return addDefaultData({
|
||||||
reference: route.params.id,
|
reference: route.params.id,
|
||||||
|
hasFile: $props.hasFile,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue