From a26b1d158edc2d431e61f195da084ca718958106 Mon Sep 17 00:00:00 2001 From: jujijigo Date: Thu, 4 Apr 2024 00:28:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dcrud=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=AD=90=E7=BB=84=E4=BB=B6DatePicker?= =?UTF-8?q?=E6=B8=85=E9=99=A4=E6=8C=89=E9=92=AE=E6=9C=AA=E5=AE=8C=E5=85=A8?= =?UTF-8?q?=E6=8C=89=E9=A2=84=E6=9C=9F=E5=B7=A5=E4=BD=9C=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/searchFormItem/form-picker.vue | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/ma-crud/components/searchFormItem/form-picker.vue b/src/components/ma-crud/components/searchFormItem/form-picker.vue index da3e8bdc..a53eb4f6 100644 --- a/src/components/ma-crud/components/searchFormItem/form-picker.vue +++ b/src/components/ma-crud/components/searchFormItem/form-picker.vue @@ -42,15 +42,23 @@ const value = computed({ let val = get(searchForm.value, props.component.dataIndex) if (val === undefined) { if (props.component.formType === 'range') { - return props.component.searchDefaultValue ?? [] + val = props.component.searchDefaultValue ?? [] } else { - return props.component.searchDefaultValue ?? '' + val = props.component.searchDefaultValue ?? '' } - } else { - return val } + + return val }, set(newVal) { + if (newVal === undefined) { + if (props.component.formType === 'range') { + newVal = [] + } else { + newVal = '' + } + } + emit('update:modelValue', newVal) set(searchForm.value, props.component.dataIndex, newVal) }