Vant: [Bug Report] Calendar does not show current month with larger screen sizes

Created on 14 Oct 2020  ·  5Comments  ·  Source: youzan/vant

Device / Browser

Chrome Desktop

Vant Version

2.10.9

Vue Version

2.6.11

Reproduction Link

https://codesandbox.io/s/vant-calendar-issue-5meu0

Describe the bug

When opening the calendar, it will not show the current month if the browser window height is above 1120px.

At a window height below 1120px it works as expected.

🐞 bug

All 5 comments

Below 1120px:

Screenshot 2020-10-14 at 11 18 22

Above 1120px:

Screenshot 2020-10-14 at 11 18 33

Will be fixed in the next version 👌

@chenjiahan 这个问题我看是代码中是初始化时只渲染上个月,当前月和下个月,因为Month是lazyRender,初始化时不能获取到month-body高度,所以请教下修改方向
months.forEach((month, index) => { month.visible = index >= visibleIndex - 1 && index <= visibleIndex + 1; });

In the current version, you can disable the lazy-render prop to avoid this problem

<van-calendar :lazy-render="false" />

In the next version, we will adjust the logic of lazy render to avoid this issue.

Fixed in version 2.10.10.

Was this page helpful?
0 / 5 - 0 ratings