Skip to content

[Calendar 日历] format 只在初始化第一次的时候有效,panel-change或者尝试刷新单行/双行描述无效 #4647

Closed

Description

@BradYan

选择框架

tdesign-miniprogram

NPM 包版本

是

基础库调试库版本(如果出现问题的框架为 tdesign-miniprogram,请提供基础调试库版本)

3.0.2

重现链接

calendarFormatFn(day) { const posYMD = getDateYYYYMMDD(day.date) const calendar = this.data.calendar const dayKey = 'd' + posYMD if (calendar && calendar[dayKey]) { day.suffix = calendar[dayKey] } else { day.suffix = '' } return day }, async initDoListSummary(e) { let yM = getDateYYYYMM() let calendar = await getCalendarAggregate(yM) const newFormatFn = (day) => { return this.calendarFormatFn(day) } this.setData({ calendar, doListFormat: newFormatFn }) }, async handlePanelChange(e) { const { year, month } = e.detail let yM = year * 100 + month const calendar = await getCalendarAggregate(yM) const newFormatFn = (day) => { return this.calendarFormatFn(day) } this.setData({ calendar, doListFormat: newFormatFn }) }

重现步骤

1.在首次加载的时候, 调用initDoListSummary , 初始化时设置了Calendar的单行描述显示,
2.之后通过左右切换Panel, 调用 handlePanelChange, 尝试修改format永远无效,
3.造成的问题就是format永远无法动态刷新.

期望结果

切换月份的时候, 去数据库获取数据, 刷新当前月份的单行描述显示.

实际结果

造成的问题就是format永远无法动态刷新.

补充说明

比如设计一个用户待做清单, 用户查看当月每天有几件事需要做的, 通过单行描述显示.
当用户切换月份, format应当动态刷新新的月份数据.
或者新建一条时, 当天条数显示应当增加1.

其它任何使用单行描述场景,都有这样的问题,不可能初始化加载全部数据.也不可能页面单行显示不能刷新.

粘贴截图一直不成功.

Activity

  1. github-actions commented on Sep 20, 2026

    @github-actions
    Contributor

    👋 @BradYan,感谢给 TDesign 提出了 issue。
    请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

  2. BradYan commented on Sep 20, 2026

    @BradYan
    Author
    Image

    新增效果图

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions