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

怎么动态添加日期标记圆圈啊,我这边是拿后台返回的数据去循环日期有相等的日期就标记圆圈 #102

Open
wo139472 opened this issue Jun 29, 2022 · 11 comments

Comments

@wo139472
Copy link

No description provided.

@TangSY
Copy link
Owner

TangSY commented Jun 29, 2022

取出需要被标记的日期,给 markDate 赋值就可以了

@wo139472
Copy link
Author

那我应该放在哪里操作呢,我放在计算属性和filters里好像都不行,用的那个dayslot插槽

@wo139472
Copy link
Author

image

@wo139472
Copy link
Author

image

@TangSY
Copy link
Owner

TangSY commented Jun 29, 2022

你在获取到日期之后,筛选出需要被标记的日期给 markDate 赋值即可,不需要使用 slot。
或者使用 watch 监听接口返回的数据,然后赋值也行

@wo139472
Copy link
Author

但是你日历这边的日期我不知道哦,我是要拿你组件这边返回的日期范围去循环我接口返回的日期范围去判断有没有相等的时间才标记圆圈

@TangSY
Copy link
Owner

TangSY commented Jun 29, 2022

你按我说的做就好了,不需要你自己匹配日期,要是设计这样的 API 用着不累吗?你直接传需要标记的日期就好了

@TangSY
Copy link
Owner

TangSY commented Jun 29, 2022

我文档也没说让你自己匹配呀

@wo139472
Copy link
Author

现在理解了,我反应太慢了,多谢

@wo139472
Copy link
Author

wo139472 commented Jun 29, 2022

还有一个问题,这个切换日历展示类型时第一次点击时方法里面的内容不触发,我打印console.log第一次的时候不会触发
image

@GT11070123
Copy link

想请教一下:如何拿到日历当前展示的起至日期呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants