提交 112ee146 编写于 作者: D dolymood

fix(form): do not get btn field value

上级 6cf505b4
...@@ -62,6 +62,15 @@ ...@@ -62,6 +62,15 @@
} }
}, },
computed: { computed: {
fieldsModel() {
const model = {}
this.fields.forEach((fieldComponent) => {
if (!fieldComponent.isBtnField) {
model[fieldComponent.fieldValue.modelKey] = fieldComponent.modelValue
}
})
return model
},
groups() { groups() {
const schema = this.schema const schema = this.schema
const groups = schema.groups || [] const groups = schema.groups || []
...@@ -127,13 +136,13 @@ ...@@ -127,13 +136,13 @@
// sync all fields value because of trigger: blur or debounce // sync all fields value because of trigger: blur or debounce
this.syncValidatorValues() this.syncValidatorValues()
if (this.skipValidate) { if (this.skipValidate) {
this.$emit(EVENT_SUBMIT, e, this.model) this.$emit(EVENT_SUBMIT, e, this.model, this.fieldsModel)
return return
} }
const submited = (submitResult) => { const submited = (submitResult) => {
if (submitResult) { if (submitResult) {
this.$emit(EVENT_VALID, this.validity) this.$emit(EVENT_VALID, this.validity)
this.$emit(EVENT_SUBMIT, e, this.model) this.$emit(EVENT_SUBMIT, e, this.model, this.fieldsModel)
} else { } else {
e.preventDefault() e.preventDefault()
this.$emit(EVENT_INVALID, this.validity) this.$emit(EVENT_INVALID, this.validity)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册