Skip to content

Commit 364a1ce

Browse files
committed
fix model-changed event value
1 parent 0c84de0 commit 364a1ce

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

dev/full/app.vue

-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@
191191
192192
modelUpdated(newVal, schema) {
193193
console.log("main model has updated", newVal, schema);
194-
// this.model[schema] = newVal;
195194
}
196195
197196

src/fields/abstractField.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,11 @@ export default {
3131

3232
if (isFunction(this.schema.set)) {
3333
this.schema.set(this.model, newValue);
34-
// console.log("model-updated via schema", this.model[this.schema.model]);
35-
this.$emit("model-updated", this.model[this.schema.model], this.schema.model);
34+
this.$emit("model-updated", newValue, this.schema.model);
3635

3736
} else if (this.schema.model) {
3837
this.setModelValueByPath(this.schema.model, newValue);
39-
40-
// console.log("model-updated via normal", this.model[this.schema.model]);
41-
this.$emit("model-updated", this.model[this.schema.model], this.schema.model);
38+
this.$emit("model-updated", newValue, this.schema.model);
4239
}
4340
}
4441
}
@@ -93,7 +90,7 @@ export default {
9390

9491
clearValidationErrors() {
9592
if (isUndefined(this.schema.errors))
96-
this.$set(this.schema, "errors", []); // Be reactive
93+
this.$root.$set(this.schema, "errors", []); // Be reactive
9794
else
9895
this.schema.errors.splice(0); // Clear
9996
},

src/formGenerator.vue

-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ div
226226
});
227227
},
228228
modelUpdated(newVal, schema){
229-
// console.log("a child model has updated", newVal, schema);
230229
this.$emit("model-updated", newVal, schema);
231230
},
232231
buttonVisibility(field) {

0 commit comments

Comments
 (0)