mirror of https://github.com/ElemeFE/element
input add validateEvent prop
parent
0922fc3683
commit
b9eed734e2
|
@ -113,7 +113,11 @@
|
||||||
maxlength: Number,
|
maxlength: Number,
|
||||||
minlength: Number,
|
minlength: Number,
|
||||||
max: {},
|
max: {},
|
||||||
min: {}
|
min: {},
|
||||||
|
validateEvent: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -131,7 +135,9 @@
|
||||||
methods: {
|
methods: {
|
||||||
handleBlur(event) {
|
handleBlur(event) {
|
||||||
this.$emit('blur', event);
|
this.$emit('blur', event);
|
||||||
|
if (this.validateEvent) {
|
||||||
this.dispatch('ElFormItem', 'el.form.blur', [this.currentValue]);
|
this.dispatch('ElFormItem', 'el.form.blur', [this.currentValue]);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
inputSelect() {
|
inputSelect() {
|
||||||
this.$refs.input.select();
|
this.$refs.input.select();
|
||||||
|
@ -162,8 +168,10 @@
|
||||||
this.currentValue = value;
|
this.currentValue = value;
|
||||||
this.$emit('input', value);
|
this.$emit('input', value);
|
||||||
this.$emit('change', value);
|
this.$emit('change', value);
|
||||||
|
if (this.validateEvent) {
|
||||||
this.dispatch('ElFormItem', 'el.form.change', [value]);
|
this.dispatch('ElFormItem', 'el.form.change', [value]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
|
|
Loading…
Reference in New Issue