From a140117e8b5fcec57ec036781ebc76b662e55e85 Mon Sep 17 00:00:00 2001 From: johnsonwong666 <1067100250@qq.com> Date: Wed, 17 May 2023 10:02:45 +0800 Subject: [PATCH] fix(Calendar): fix month title sync --- packages/calendar/README.md | 4 +++- packages/calendar/demo/index.less | 2 +- packages/common/style/var.less | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/calendar/README.md b/packages/calendar/README.md index 5844cbdc..05349ae5 100644 --- a/packages/calendar/README.md +++ b/packages/calendar/README.md @@ -257,10 +257,12 @@ Page({ ```css .calendar { - --calendar-height: 500px; + --calendar-height: 618px; } ``` +> Tips: 注意,在自定义calendar的高度时,需要确保,滚动到当前月份时,所有的日期要展现在.van-calendar__body内,否则可能会出现滚动时头部月份与当前月份不同步的情况。目前平铺型预设高度618px,弹窗型高度90%。 + ## API ### Props diff --git a/packages/calendar/demo/index.less b/packages/calendar/demo/index.less index c4b0001f..ad853ccc 100644 --- a/packages/calendar/demo/index.less +++ b/packages/calendar/demo/index.less @@ -1,3 +1,3 @@ .tiled-calendar { - --calendar-height: 500px; + --calendar-height: 618px; } diff --git a/packages/common/style/var.less b/packages/common/style/var.less index 762e9314..719bd951 100644 --- a/packages/common/style/var.less +++ b/packages/common/style/var.less @@ -123,7 +123,7 @@ // Calendar @calendar-height: 100%; @calendar-background-color: @white; -@calendar-popup-height: 80%; +@calendar-popup-height: 90%; @calendar-header-box-shadow: 0 2px 10px rgba(125, 126, 128, 0.16); @calendar-header-title-height: 44px; @calendar-header-title-font-size: @font-size-lg;