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

表单rule增加一个groupId选项 #588

Open
hans000 opened this issue May 16, 2023 · 0 comments
Open

表单rule增加一个groupId选项 #588

hans000 opened this issue May 16, 2023 · 0 comments

Comments

@hans000
Copy link

hans000 commented May 16, 2023

业务场景

有两个按钮分别是【暂存】【提交】,点击【暂存】时要求只校验部分规则(如:字符长度,选择数量,不做必填校验)点击【提交】时全部规则校验。

一般实现这个功能可能要借助一个flag去判断,这使得业务代码看着挺乱的。

现在希望添加Rule 增加 groupId 字段用于给规则分组,添加validateFieldsByGroupIds(['groupId1', 'groupId2'])去校验对应的规则

或者改造增强validateFields方法,给一个predicate去断言

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

1 participant