File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 5555 immediateValidate: {
5656 type: Boolean ,
5757 default: false
58+ },
59+ submitAlwaysValidate: {
60+ type: Boolean ,
61+ default: false
5862 }
5963 },
6064 data () {
8589 }
8690 return groups
8791 },
92+ fieldsData () {
93+ return this .groups .reduce ((fields , group ) => {
94+ group .fields .reduce ((fields , field ) => {
95+ fields .push (field)
96+ return fields
97+ }, fields)
98+ return fields
99+ }, [])
100+ },
88101 layout () {
89102 const options = this .options
90103 const layout = (options && options .layout ) || LAYOUTS .STANDARD
156169 this .$emit (EVENT_INVALID , this .validity )
157170 }
158171 }
159- if (this .valid === undefined ) {
172+ if (this .submitAlwaysValidate || this . valid === undefined ) {
160173 this ._submit (submited)
161174 if (this .validating || this .pending ) {
162175 // async validate
299312 })
300313 },
301314 addField (fieldComponent ) {
302- this .fields .push (fieldComponent)
315+ const i = this .fieldsData .indexOf (fieldComponent .field )
316+ this .fields .splice (i, 0 , fieldComponent)
303317 const modelKey = fieldComponent .fieldValue .modelKey
304318 modelKey && this .setValidity (modelKey)
305319 },
You can’t perform that action at this time.
0 commit comments