-
El-autocomplete disallows entering Chinese and numbers:
Solution: Bind onInput event and return the corresponding value. Note: This method works with element2.4.11 (the most recent version). 2.4.11 this refers to the input element, but not 2.3.9, where this refers to a div element without the value attribute.
<el-autocomplete oninput="this.value=this.value.replace(/[\u4e00-\u9fa5\d]/g,'');"></el-autocomplete>
Copy the code
-
El-autocomplete Manual blur
<el-autocomplete ref="auto" v-model="input"></el-autocomplete>
this.$refs.auto.close();
this.$refs.auto.$children[0].blur();
Copy the code