refactor: reset on leave
This commit is contained in:
parent
4f9ca4bd17
commit
458c1663bf
2 changed files with 7 additions and 1 deletions
|
|
@ -64,6 +64,7 @@ const fileFormData = ref<{
|
|||
const fileFormType = ref<'edit' | 'create'>('create')
|
||||
const fileFormError = ref<{ fileExist?: boolean; fileName2Long?: boolean }>({})
|
||||
const fileExistNotification = ref<boolean>(false)
|
||||
const fileFormComponent = ref<InstanceType<typeof FileForm>>()
|
||||
|
||||
function triggerFolderDelete(pathname: string) {
|
||||
deleteFormType.value = 'deleteFolder'
|
||||
|
|
@ -176,6 +177,7 @@ async function submitFileForm(
|
|||
fileFormData.value = {}
|
||||
fileFormState.value = false
|
||||
currentParam.value = undefined
|
||||
fileFormComponent.value?.reset()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
@ -379,6 +381,7 @@ async function submitFileForm(
|
|||
</div>
|
||||
|
||||
<file-form
|
||||
ref="fileFormComponent"
|
||||
:mode="fileFormType"
|
||||
:error="fileFormError"
|
||||
v-model:open="fileFormState"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue