fix dynamic form item validate bug (#1207)

pull/1214/head
baiyaaaaa 2016-11-18 22:05:31 +08:00 committed by cinwell.li
parent 35b979da54
commit 5b6dc77243
3 changed files with 10 additions and 6 deletions

View File

@ -122,7 +122,7 @@
},
dynamicForm: {
domains: [{
key: 1,
key: Date.now(),
value: ''
}],
email: ''
@ -189,7 +189,7 @@
},
addDomain() {
this.dynamicForm.domains.push({
key: this.dynamicForm.domains.length,
key: Date.now(),
value: ''
});
}
@ -819,6 +819,7 @@ Form component allows you to verify your data, helping you find and correct erro
| label | label | 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 |
| rules | validation rules of form | object | — | — |

View File

@ -122,7 +122,7 @@
},
dynamicForm: {
domains: [{
key: 1,
key: Date.now(),
value: ''
}],
email: ''
@ -189,7 +189,7 @@
},
addDomain() {
this.dynamicForm.domains.push({
key: this.dynamicForm.domains.length,
key: Date.now(),
value: ''
});
}
@ -810,3 +810,4 @@
| label | 标签文本 | string | — | — |
| label-width | 表单域标签的的宽度,例如 '50px' | string | — | — |
| required | 是否必填,如不设置,则会根据校验规则自动生成 | bolean | — | false |
| rules | 表单验证规则 | object | — | — |

View File

@ -36,8 +36,10 @@
});
/* istanbul ignore next */
this.$on('el.form.removeField', (field) => {
if (this.fields[field.prop]) {
delete this.fields[field.prop];
this.fieldLength--;
}
});
},
methods: {