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] + } + }, + } + }, }