vant
Version:
Mobile UI Components built on Vue
24 lines (22 loc) • 419 B
JavaScript
export var FieldMixin = {
inject: {
vanField: {
default: null
}
},
watch: {
value: function value() {
var field = this.vanField;
if (field) {
field.resetValidation();
field.validateWithTrigger('onChange');
}
}
},
created: function created() {
var field = this.vanField;
if (field && !field.children) {
field.children = this;
}
}
};