From cf706a9e5bf08088d6349809bb181bd3f926e5d1 Mon Sep 17 00:00:00 2001 From: TTTTian <15829010387@163.com> Date: Tue, 4 Jun 2024 10:05:13 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=97=A5=E6=9C=9F=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=EF=BC=9A=E5=B7=B2=E9=80=89=E4=B8=AD=E9=BB=98=E8=AE=A4=E5=80=BC?= =?UTF-8?q?=EF=BC=8C=E6=98=BE=E7=A4=BA=E7=B1=BB=E5=9E=8B=E5=9C=A8=E7=94=B1?= =?UTF-8?q?=20dates=20=E5=88=87=E6=8D=A2=20=E5=88=B0=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=EF=BC=8C=E6=88=96=E5=85=B6=E4=BB=96=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=88=87=E6=8D=A2=E5=88=B0=20dates=20=E6=97=B6=20?= =?UTF-8?q?=E7=9A=84=E6=8A=A5=E9=94=99=E5=AF=BC=E8=87=B4=E6=95=B4=E4=B8=AA?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=97=A0=E5=93=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form-widget/field-widget/date-widget.vue | 15 ++++++++++++++- .../field-date/date-defaultValue-editor.vue | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/components/form-designer/form-widget/field-widget/date-widget.vue b/src/components/form-designer/form-widget/field-widget/date-widget.vue index 5452d82..0148f77 100644 --- a/src/components/form-designer/form-widget/field-widget/date-widget.vue +++ b/src/components/form-designer/form-widget/field-widget/date-widget.vue @@ -2,7 +2,7 @@ - - @@ -18,6 +18,19 @@ selectedWidget: Object, optionModel: Object, }, + watch: { + 'optionModel.type': { + deep: true, + handler(val, oldVal){ + if (val === 'dates' && oldVal !== 'dates'){ + this.optionModel.defaultValue = [this.optionModel.defaultValue] + } + if (val !== 'dates' && oldVal === 'dates'){ + this.optionModel.defaultValue = this.optionModel.defaultValue[0] + } + }, + } + }, }