Skip to content

Commit

Permalink
fix model-changed event value
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Feb 13, 2017
1 parent 0c84de0 commit 364a1ce
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
1 change: 0 additions & 1 deletion dev/full/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@
modelUpdated(newVal, schema) {
console.log("main model has updated", newVal, schema);
// this.model[schema] = newVal;
}
Expand Down
9 changes: 3 additions & 6 deletions src/fields/abstractField.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,11 @@ export default {

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

} else if (this.schema.model) {
this.setModelValueByPath(this.schema.model, newValue);

// console.log("model-updated via normal", this.model[this.schema.model]);
this.$emit("model-updated", this.model[this.schema.model], this.schema.model);
this.$emit("model-updated", newValue, this.schema.model);
}
}
}
Expand Down Expand Up @@ -93,7 +90,7 @@ export default {

clearValidationErrors() {
if (isUndefined(this.schema.errors))
this.$set(this.schema, "errors", []); // Be reactive
this.$root.$set(this.schema, "errors", []); // Be reactive
else
this.schema.errors.splice(0); // Clear
},
Expand Down
1 change: 0 additions & 1 deletion src/formGenerator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ div
});
},
modelUpdated(newVal, schema){
// console.log("a child model has updated", newVal, schema);
this.$emit("model-updated", newVal, schema);
},
buttonVisibility(field) {
Expand Down

0 comments on commit 364a1ce

Please sign in to comment.