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

请问 calendar组件多选后可以初始化吗? #2160

Closed
CaiJW13 opened this issue Nov 2, 2017 · 4 comments
Closed

请问 calendar组件多选后可以初始化吗? #2160

CaiJW13 opened this issue Nov 2, 2017 · 4 comments

Comments

@CaiJW13
Copy link

CaiJW13 commented Nov 2, 2017

现在calendar组件多选后,没有命令初始化,直接让v-model绑定的值为空也不会重新渲染,这种情况当需要公用calendar组件的时候就会很麻烦。

@airyland
Copy link
Owner

airyland commented Nov 2, 2017

不明白你要怎样初始化,返回当前月视图?

@CaiJW13
Copy link
Author

CaiJW13 commented Nov 3, 2017

a45378e80111c44980d92ba543149cf8

我使用的是多选功能
图一,为初次调用时的界面

00b

图二,为选取日期后界面。

当再次调用时,界面还是保持图二的状态,系统有提供方法可以回到图一的状态吗?

@airyland
Copy link
Owner

airyland commented Nov 3, 2017

将 v-model 绑定值重置没效果么?

@CaiJW13
Copy link
Author

CaiJW13 commented Nov 3, 2017

试过,不行。具体情况是:再次调用时,在methods中将 v-model 绑定值赋值为空数组[],生成的界面没有清空数据,如图一

63692b7da546ef41a9a17c94f2cba577

然后,点击图一区域触发弹起日历表,界面为图二:

8f3d35e8fc6fe6448bbe60aa5df67af1

但是在这种情况下会出现bug:弹出的日历表(图二)点击取消按钮,图一的值会重新渲染到日历表上,只有点击确定按钮才可以真正实现清空界面。是否是取消按钮触发的事件另外存储了一组数据,导致不能通过清空v-model的值来实现初始化。

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