larrykkk / notes

個人筆記
1 stars 0 forks source link

Element ui autocomplete enter 以後關閉 選項提示框 #11

Open larrykkk opened 5 years ago

larrykkk commented 5 years ago

先給 <el-autotcomplete> 一個 ref="autocomplete"

然後在

@keyup.enter.native.prevent="inputSearch(keyword)"

裡面寫

this.$refs.autocomplete.$refs.suggestions.showPopper = false;

這樣按下 enter 之後就會一起將提示框關閉了