Commit 5b6dc772 authored by baiyaaaaa's avatar baiyaaaaa Committed by cinwell.li

fix dynamic form item validate bug (#1207)

parent 35b979da
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
}, },
dynamicForm: { dynamicForm: {
domains: [{ domains: [{
key: 1, key: Date.now(),
value: '' value: ''
}], }],
email: '' email: ''
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
}, },
addDomain() { addDomain() {
this.dynamicForm.domains.push({ this.dynamicForm.domains.push({
key: this.dynamicForm.domains.length, key: Date.now(),
value: '' value: ''
}); });
} }
...@@ -819,6 +819,7 @@ Form component allows you to verify your data, helping you find and correct erro ...@@ -819,6 +819,7 @@ Form component allows you to verify your data, helping you find and correct erro
| label | label | string | — | — | | label | label | string | — | — |
| label-width | width of label, e.g. '50px' | string | — | — | | label-width | width of label, e.g. '50px' | string | — | — |
| required | whether the field is required or not, will be determined by validation rules if omitted | string | — | false | | required | whether the field is required or not, will be determined by validation rules if omitted | string | — | false |
| rules | validation rules of form | object | — | — |
......
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
}, },
dynamicForm: { dynamicForm: {
domains: [{ domains: [{
key: 1, key: Date.now(),
value: '' value: ''
}], }],
email: '' email: ''
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
}, },
addDomain() { addDomain() {
this.dynamicForm.domains.push({ this.dynamicForm.domains.push({
key: this.dynamicForm.domains.length, key: Date.now(),
value: '' value: ''
}); });
} }
...@@ -810,3 +810,4 @@ ...@@ -810,3 +810,4 @@
| label | 标签文本 | string | — | — | | label | 标签文本 | string | — | — |
| label-width | 表单域标签的的宽度,例如 '50px' | string | — | — | | label-width | 表单域标签的的宽度,例如 '50px' | string | — | — |
| required | 是否必填,如不设置,则会根据校验规则自动生成 | bolean | — | false | | required | 是否必填,如不设置,则会根据校验规则自动生成 | bolean | — | false |
| rules | 表单验证规则 | object | — | — |
...@@ -36,8 +36,10 @@ ...@@ -36,8 +36,10 @@
}); });
/* istanbul ignore next */ /* istanbul ignore next */
this.$on('el.form.removeField', (field) => { this.$on('el.form.removeField', (field) => {
delete this.fields[field.prop]; if (this.fields[field.prop]) {
this.fieldLength--; delete this.fields[field.prop];
this.fieldLength--;
}
}); });
}, },
methods: { methods: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment