We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://vipshop.github.io/ncform/ncform-theme-elementui/index.html 类似例子中的[compound.prependSelect: 前置下拉框 / 本地数据源] 情况。 想验证user.name必填 require校验总是通过的
user.name
The text was updated successfully, but these errors were encountered:
fix(ncform-theme-elementui): fixed input $emit input event when init …
941a88f
…with compound.prependSelect con fix #19
当为对象时,如果对象是个空对象,会正确触发必填校验 这里比较特殊是,如果下拉框选择了值,那对象其实是有值的,而你的场景是想填了文本框才算校验通过,所以可以结合customRule来实现
customRule
注意: @ncform/ncform-theme-elementui 需要升级到0.1.14版本
@ncform/ncform-theme-elementui
示例代码如下: 打开playground 复制以下配置查看效果
{ "type": "object", "properties": { "user": { "type": "object", "ui": { "widget": "input", "widgetConfig": { "modelField": "name", "compound": { "prependSelect": { "itemLabelField": "label", "itemValueField": "value", "enumSource": [ { "value": 1, "label": "男" }, { "value": 2, "label": "女" } ], "modelField": "gender" } } } }, "rules": { "required": true, "customRule": [ { "script": "dx: {{$root.user}}.name", "errMsg": "名字必填" } ] } } } }
Sorry, something went wrong.
daniel-dx
Successfully merging a pull request may close this issue.
https://vipshop.github.io/ncform/ncform-theme-elementui/index.html 类似例子中的[compound.prependSelect: 前置下拉框 / 本地数据源] 情况。 想验证
user.name
必填require校验总是通过的
The text was updated successfully, but these errors were encountered: