mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-12-04 13:17:47 +08:00
AutoComplete: fix key enter (#2672)
This commit is contained in:
parent
abb24bba24
commit
f25b8b1edb
@ -19,7 +19,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template slot="append" v-if="$slots.append">
|
<template slot="append" v-if="$slots.append">
|
||||||
<slot name="append"></slot>
|
<slot name="append"></slot>
|
||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-autocomplete-suggestions
|
<el-autocomplete-suggestions
|
||||||
:class="[popperClass ? popperClass : '']"
|
:class="[popperClass ? popperClass : '']"
|
||||||
@ -113,7 +113,7 @@
|
|||||||
}, 100);
|
}, 100);
|
||||||
},
|
},
|
||||||
handleKeyEnter() {
|
handleKeyEnter() {
|
||||||
if (this.suggestionVisible) {
|
if (this.suggestionVisible && this.highlightedIndex >= 0 && this.highlightedIndex < this.suggestions.length) {
|
||||||
this.select(this.suggestions[this.highlightedIndex]);
|
this.select(this.suggestions[this.highlightedIndex]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user