Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多日历组件无法跳转到指定日期 #245

Closed
bighuangbee opened this issue Dec 29, 2019 · 9 comments
Closed

多日历组件无法跳转到指定日期 #245

bighuangbee opened this issue Dec 29, 2019 · 9 comments

Comments

@bighuangbee
Copy link

this.calendar.jump(2020, 2, 1, '#calendar2'); // 跳转至某日
@treadpit
Copy link
Owner

关于多日历组件有有提供一个demo,详情见: pages/calendarMoreComponent,你试下这个是否有效,我这边测试OK

image

@bighuangbee
Copy link
Author

这样的配置不行
calendarConfig1 : {
multi: true, // 是否开启多选,
theme: 'elegant', // 日历主题,目前共两款可选择,默认 default 及 elegant,自定义主题在 theme 文件夹扩展
showLunar: false, // 是否显示农历,此配置会导致 setTodoLabels 中 showLabelAlways 配置失效
inverse: 1, // 单选模式下是否支持取消选中,
defaultDay: '2019-1-11', // string|boolean,string: 默认选中某天/boolean: 不自动选中任何日期
highlightToday: false, // 是否高亮显示当天,区别于选中样式(初始化时当天高亮并不代表已选中当天)
takeoverTap: true, // 是否完全接管日期点击事件(日期不会选中),配合 onTapDay() 使用
disablePastDay: false, // 是否禁选当天之前的日期
disableLaterDay: false, // 是否禁选当天之后的日期
firstDayOfWeek: 'Mon', // 每周第一天为周一还是周日,默认按周日开始
onlyShowCurrentMonth: true, // 日历面板是否只显示本月日期
hideHeadOnWeekMode: true, // 周视图模式是否隐藏日历头部
},

@treadpit
Copy link
Owner

你需要这么多的配置?

@bighuangbee
Copy link
Author

是的,做一个日历表,显示全年的月份

@treadpit
Copy link
Owner

因为这么多配置可能存在互斥的情况,我中午看下

@bighuangbee
Copy link
Author

好的

@treadpit
Copy link
Owner

treadpit commented Jan 2, 2020

请问 this.calendar.jump(2020, 2, 1, '#calendar2'); 调用的上下文是什么
?是在 afterCalendarRender 之后调用的么?

@bighuangbee
Copy link
Author

bighuangbee commented Jan 2, 2020 via email

@treadpit
Copy link
Owner

treadpit commented Jan 2, 2020

因这里涉及的点稍多,如果急用可以先暂时使用宏任务,如下方法处理试试:

afterCalendarRender() {
  setTimeout(() => {
    this.calendar.jump(2019, 7, 23, '#start');
  }, 100);
}

@treadpit treadpit self-assigned this Jan 2, 2020
@treadpit treadpit added the bug label Jan 2, 2020
@treadpit treadpit pinned this issue Jun 18, 2020
@treadpit treadpit added the v1.x label Jan 5, 2021
@treadpit treadpit closed this as completed Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants