From 28724bba391262b2f7bf30d1ab36b7a6cb7cf0a3 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Tue, 2 Aug 2022 11:35:10 +0800 Subject: [PATCH] fix(gui-v2): destructure parts of props --- packages/nc-gui-v2/components/dlg/QuickImport.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/nc-gui-v2/components/dlg/QuickImport.vue b/packages/nc-gui-v2/components/dlg/QuickImport.vue index bfb723632e..c9ccf6dd6b 100644 --- a/packages/nc-gui-v2/components/dlg/QuickImport.vue +++ b/packages/nc-gui-v2/components/dlg/QuickImport.vue @@ -18,7 +18,7 @@ interface Props { importType: 'csv' | 'json' | 'excel' } -const props = defineProps() +const { importType, ...rest } = defineProps() const emit = defineEmits(['update:modelValue']) @@ -55,11 +55,11 @@ const importState = reactive({ }, }) -const isImportTypeJson = computed(() => props.importType === 'json') +const isImportTypeJson = computed(() => importType === 'json') -const isImportTypeCsv = computed(() => props.importType === 'csv') +const isImportTypeCsv = computed(() => importType === 'csv') -const IsImportTypeExcel = computed(() => props.importType === 'excel') +const IsImportTypeExcel = computed(() => importType === 'excel') const validators = computed(() => { return { @@ -97,7 +97,7 @@ const importMeta = computed(() => { return {} }) -const dialogShow = useVModel(props, 'modelValue', emit) +const dialogShow = useVModel(rest, 'modelValue', emit) const disablePreImportButton = computed(() => { if (activeKey.value === 'uploadTab') { @@ -117,7 +117,7 @@ const disableImportButton = computed(() => { const disableFormatJsonButton = computed(() => !jsonEditorRef.value?.isValid) const modalWidth = computed(() => { - if (props.importType === 'excel' && templateEditorModal.value) { + if (importType === 'excel' && templateEditorModal.value) { return 'max(90vw, 600px)' } return 'max(60vw, 600px)' @@ -265,7 +265,7 @@ function getAdapter(name: string, val: any) { ref="templateEditorRef" :project-template="templateData" :import-data="importData" - :quick-import-type="props.importType" + :quick-import-type="importType" @import="handleImport" />