|
15 | 15 | <div class="errors text-center">
|
16 | 16 | <div v-for="(item, index) in validationErrors" track-by="index" class="alert alert-danger">{{ item.field.label}}: <strong>{{ item.error }}</strong></div>
|
17 | 17 | </div>
|
18 | | - <vue-form-generator :schema="schema" :model="model" :options="formOptions" :multiple="selected.length > 1" ref="form" :is-new-model="isNewModel" @model-updated="modelUpdated"></vue-form-generator> |
| 18 | + <vue-form-generator :schema="schema" :model="model" :options="formOptions" :multiple="selected.length > 1" ref="form" :is-new-model="isNewModel" @model-updated="modelUpdated"@validated="onValidated"></vue-form-generator> |
19 | 19 | </div>
|
20 | 20 | <div class="col-md-6">
|
21 | 21 | <pre v-if="model" v-html="prettyModel"></pre>
|
|
113 | 113 | clearSelection() {
|
114 | 114 | this.selected.splice(0);
|
115 | 115 | this.generateModel();
|
116 | | - }, |
| 116 | + }, |
| 117 | + |
| 118 | + onValidated(res, errors) { |
| 119 | + console.log("VFG validated:", res, errors); |
| 120 | + }, |
117 | 121 |
|
118 | 122 | generateModel() {
|
119 | 123 | if (this.selected.length == 1) {
|
|
185 | 189 | },
|
186 | 190 |
|
187 | 191 | validate() {
|
188 | | - console.log("validate", this.$refs.form, this.$refs.form.validate()); |
| 192 | + //console.log("validate", this.$refs.form, this.$refs.form.validate()); |
189 | 193 | return this.$refs.form.validate();
|
190 | 194 | },
|
191 | 195 |
|
|
0 commit comments