From 3c0496f1a8d6cfc1f40dc45ed06c7e1e49ff5a7c Mon Sep 17 00:00:00 2001 From: JeremyWuuuuu <15975785+JeremyWuuuuu@users.noreply.github.com> Date: Fri, 27 May 2022 13:55:03 +0800 Subject: [PATCH] refactor(components): [time-picker] setup migration (#7908) * refactor(components): [time-picker] setup migration - Migrate panel-month-range to setup * chore: remove return expression * chore: change Array.isArray to isArray * chore: remove required parsedValue --- .../src/date-picker-com/panel-month-range.vue | 409 +++++++++--------- .../src/props/panel-month-range.ts | 2 + .../date-picker/src/props/shared.ts | 5 +- 3 files changed, 208 insertions(+), 208 deletions(-) diff --git a/packages/components/date-picker/src/date-picker-com/panel-month-range.vue b/packages/components/date-picker/src/date-picker-com/panel-month-range.vue index 96375dd720..36534aad33 100644 --- a/packages/components/date-picker/src/date-picker-com/panel-month-range.vue +++ b/packages/components/date-picker/src/date-picker-com/panel-month-range.vue @@ -95,236 +95,235 @@ - diff --git a/packages/components/date-picker/src/props/panel-month-range.ts b/packages/components/date-picker/src/props/panel-month-range.ts index cb30d2dde4..b3999d424d 100644 --- a/packages/components/date-picker/src/props/panel-month-range.ts +++ b/packages/components/date-picker/src/props/panel-month-range.ts @@ -7,4 +7,6 @@ export const panelMonthRangeProps = buildProps({ ...panelRangeSharedProps, } as const) +export const panelMonthRangeEmits = ['pick', 'set-picker-option'] + export type PanelMonthRangeProps = ExtractPropTypes diff --git a/packages/components/date-picker/src/props/shared.ts b/packages/components/date-picker/src/props/shared.ts index 287f4e8073..9bb239b562 100644 --- a/packages/components/date-picker/src/props/shared.ts +++ b/packages/components/date-picker/src/props/shared.ts @@ -3,9 +3,9 @@ import { datePickTypes } from '@element-plus/constants' import type { Dayjs } from 'dayjs' -const selectionModes = ['date', 'dates', 'year', 'month', 'week'] +const selectionModes = ['date', 'dates', 'year', 'month', 'week', 'range'] -type RangeState = { +export type RangeState = { endDate: null | Dayjs selecting: boolean } @@ -26,7 +26,6 @@ export const datePickerSharedProps = buildProps({ }, parsedValue: { type: definePropType([Object, Array]), - required: true, }, rangeState: { type: definePropType(Object),