From 1e6dbd85584cf366d02773f809377face6ba4416 Mon Sep 17 00:00:00 2001 From: qiang Date: Sat, 3 Sep 2022 23:23:10 +0800 Subject: [PATCH] refactor(components): [calendar] rename slot dateCell to date-cell (#9590) * refactor(components): [calendar] rename slot dateCell to date-cell closed 9565 * docs: update * fix(components): [calendar] avoid slots taking effect at the same time --- docs/en-US/component/calendar.md | 9 ++--- docs/examples/calendar/customize.vue | 2 +- docs/examples/calendar/header.vue | 24 +++++++------- .../calendar/__tests__/calendar.test.tsx | 16 +++++++++ packages/components/calendar/src/calendar.vue | 33 +++++++++++++++---- .../components/calendar/src/date-table.vue | 2 +- 6 files changed, 62 insertions(+), 24 deletions(-) diff --git a/docs/en-US/component/calendar.md b/docs/en-US/component/calendar.md index e77b31a906..9f89658c39 100644 --- a/docs/en-US/component/calendar.md +++ b/docs/en-US/component/calendar.md @@ -17,7 +17,7 @@ calendar/basic ## Custom Content -:::demo Customize what is displayed in the calendar cell by setting `scoped-slot` named `dateCell`. In `scoped-slot` you can get the date (the date of the current cell), data (including the type, isSelected, day attribute). For details, please refer to the API documentation below. +:::demo Customize what is displayed in the calendar cell by setting `scoped-slot` named `date-cell`. In `scoped-slot` you can get the date (the date of the current cell), data (including the type, isSelected, day attribute). For details, please refer to the API documentation below. calendar/customize @@ -54,6 +54,7 @@ Note, date time locale (month name, first day of the week ...) are also configur ## Slots -| Name | Description | Attribute | -| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | -| dateCell | { type, isSelected, day, date }. `type` indicates which month the date belongs, optional values are prev-month, current-month, next-month; `isSelected` indicates whether the date is selected; `day` is the formatted date in the format YYYY-MM-DD; `date` is date the cell represents | data | +| Name | Description | Attribute | +| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | +| date-cell | { type, isSelected, day, date }. `type` indicates which month the date belongs, optional values are prev-month, current-month, next-month; `isSelected` indicates whether the date is selected; `day` is the formatted date in the format YYYY-MM-DD; `date` is date the cell represents | data | +| header | content of the Calendar header | — | diff --git a/docs/examples/calendar/customize.vue b/docs/examples/calendar/customize.vue index f5e338ced4..f02487b2d3 100644 --- a/docs/examples/calendar/customize.vue +++ b/docs/examples/calendar/customize.vue @@ -1,6 +1,6 @@