Skip to content

Commit

Permalink
input add validateEvent prop
Browse files Browse the repository at this point in the history
  • Loading branch information
baiyaaaaa authored and Leopoldthecoder committed Dec 30, 2016
1 parent 0922fc3 commit b9eed73
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/input/src/input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@
maxlength: Number,
minlength: Number,
max: {},
min: {}
min: {},
validateEvent: {
type: Boolean,
default: true
}
},
computed: {
Expand All @@ -131,7 +135,9 @@
methods: {
handleBlur(event) {
this.$emit('blur', event);
this.dispatch('ElFormItem', 'el.form.blur', [this.currentValue]);
if (this.validateEvent) {
this.dispatch('ElFormItem', 'el.form.blur', [this.currentValue]);
}
},
inputSelect() {
this.$refs.input.select();
Expand Down Expand Up @@ -162,7 +168,9 @@
this.currentValue = value;
this.$emit('input', value);
this.$emit('change', value);
this.dispatch('ElFormItem', 'el.form.change', [value]);
if (this.validateEvent) {
this.dispatch('ElFormItem', 'el.form.change', [value]);
}
}
},
Expand Down

0 comments on commit b9eed73

Please sign in to comment.