Skip to content

Commit

Permalink
fix(form): ensure that the hidden fields of the form are verified pro…
Browse files Browse the repository at this point in the history
…perly, fix #413
  • Loading branch information
anncwb committed Mar 25, 2021
1 parent 5c57a1d commit 237f41d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- 确保 progress 进度条正确关闭
- 修复表格勾选列配置失效问题
- 确保一级菜单可以被隐藏
- 确保表单隐藏字段校验正常

### 🎫 Chores

Expand Down
4 changes: 2 additions & 2 deletions src/components/Form/src/components/FormItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@
if (!isShow) {
rule.required = false;
}
if (rule.required && component) {
if (component) {
if (!Reflect.has(rule, 'type')) {
rule.type = 'string';
rule.type = component === 'InputNumber' ? 'number' : 'string';
}
const joinLabel = Reflect.has(props.schema, 'rulesMessageJoinLabel')
? rulesMessageJoinLabel
Expand Down
2 changes: 1 addition & 1 deletion src/design/ant/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}

span.anticon:not(.app-iconify) {
vertical-align: 0.135em;
vertical-align: 0.125em !important;
}

.ant-back-top {
Expand Down
8 changes: 8 additions & 0 deletions src/views/demo/form/RuleForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@
},
required: true,
},
{
field: 'id',
label: 'id',
required: true,
defaultValue: 0,
component: 'InputNumber',
show: false,
},
{
field: 'field3',
component: 'DatePicker',
Expand Down

0 comments on commit 237f41d

Please sign in to comment.