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

Switch开关的事件的问题 #353

Open
1 task
bitker opened this issue Nov 28, 2023 · 2 comments
Open
1 task

Switch开关的事件的问题 #353

bitker opened this issue Nov 28, 2023 · 2 comments

Comments

@bitker
Copy link

bitker commented Nov 28, 2023

Basic Info

  • Browser: firefox120.0
  • Framework version: VUE
  • Package Name And Version: arco-design-pro-vue@2.7.2

What is expected?

change事件应该需要做到能恢复状态的功能。现在每次点击就自动开或关。后台有时是不允许开关。这方面elemetui的 Switch做的比较好,他直接在change事件里面恢复当前值就行。或者像ant 的事件那样返回true再进行切换switch的开或关。现在的change事件确实很鸡肋,点击开启或关闭后就是固定了,完全没有考虑到不允许的情况下。有朋友建议用拦截。这个拦截其实很没有必要,每次加载都会执行拦截的。

@oknixus
Copy link

oknixus commented May 2, 2024

我也折腾了好长时间,最后想了想,一般情况下,这个只要开或关,几乎不会遇到失败的情况,就先不考虑接口调用失败时的回退了吧,我可以在调用失败的时候,刷新一下整个页面

@oknixus
Copy link

oknixus commented May 2, 2024

拦截很鸡肋,只传一个boolean值,无法获取到相关数据,没办法调接口去修改

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

2 participants