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

[FR]: dialog希望可以控制确定按钮是否默认关闭弹窗 #2626

Closed
wmz46 opened this issue Oct 30, 2023 · 0 comments
Closed

[FR]: dialog希望可以控制确定按钮是否默认关闭弹窗 #2626

wmz46 opened this issue Oct 30, 2023 · 0 comments
Labels
Feature Request 新功能请求
Milestone

Comments

@wmz46
Copy link

wmz46 commented Oct 30, 2023

这个功能解决了什么问题?

增加ok-auto-close属性,确定按钮是否默认关闭弹窗,功能类似cancel-auto-close

目前遇到的问题是在dialog中使用v-model:visible进行双向绑定时,点击确定按钮会自动关闭对话框。
有时,会在弹窗中放一两个输入域,需要在确定时做一些校验,校验通过才关闭。目前貌似无法解决。

以下是两种目前的处理方案,但是都存在弊端:
1.不使用v-model:visible进行双向绑定,而是使用:visible,然后在确定和取消按钮中自己控制visible。这种会导致点击蒙层时无法关闭弹窗。
2.隐藏内置的确定和取消按钮,在对话框中自己组装确定和取消按钮。这种会导致代码量增加很多,而且风格较难统一。

你期望的组件设计是怎样的?

增加ok-auto-close属性,确定按钮是否默认关闭弹窗,功能类似cancel-auto-close

@wmz46 wmz46 added the Feature Request 新功能请求 label Oct 30, 2023
@wmz46 wmz46 changed the title [FR]: dialog希望在可以控制确定按钮是否默认关闭弹窗 [FR]: dialog希望可以控制确定按钮是否默认关闭弹窗 Oct 30, 2023
@eiinu eiinu added this to the v4.2.1 milestone Oct 30, 2023
@eiinu eiinu closed this as completed Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request 新功能请求
Projects
None yet
Development

No branches or pull requests

2 participants