mirror of https://github.com/ElemeFE/element
fix input blur event
parent
7667396907
commit
634498bbff
|
@ -203,9 +203,7 @@
|
||||||
|
|
||||||
::: demo
|
::: demo
|
||||||
```html
|
```html
|
||||||
<el-input
|
<el-input v-model="input" placeholder="请输入内容">
|
||||||
placeholder="请输入内容"
|
|
||||||
v-model="input">
|
|
||||||
</el-input>
|
</el-input>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
@blur="handleBlur"
|
@blur="handleBlur"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:size="size"
|
:size="size"
|
||||||
|
ref="input"
|
||||||
>
|
>
|
||||||
<template slot="prepend" v-if="$slots.prepend">
|
<template slot="prepend" v-if="$slots.prepend">
|
||||||
<slot name="prepend"></slot>
|
<slot name="prepend"></slot>
|
||||||
|
@ -191,7 +192,7 @@
|
||||||
this.currentValue = this.accSub(value, this.step);
|
this.currentValue = this.accSub(value, this.step);
|
||||||
},
|
},
|
||||||
handleBlur() {
|
handleBlur() {
|
||||||
this.currentValue = this.value;
|
this.$refs.input.setCurrentValue(this.currentValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -132,7 +132,6 @@
|
||||||
handleBlur(event) {
|
handleBlur(event) {
|
||||||
this.$emit('blur', event);
|
this.$emit('blur', event);
|
||||||
this.dispatch('ElFormItem', 'el.form.blur', [this.currentValue]);
|
this.dispatch('ElFormItem', 'el.form.blur', [this.currentValue]);
|
||||||
this.currentValue = this.value;
|
|
||||||
},
|
},
|
||||||
inputSelect() {
|
inputSelect() {
|
||||||
this.$refs.input.select();
|
this.$refs.input.select();
|
||||||
|
|
Loading…
Reference in New Issue