el-input 聯動觸發 el-autocomplete

前端入门菜鸟發表於2024-05-28
<el-input v-model.trim="name" @input="projectNameInput" />
projectNameInput(value) {
  this.keyword = value
  this.$refs.autocomplete.handleInput(value);
  this.$refs.autocomplete.activated = true;//這句話是重點
}
<el-autocomplete  ref="autocomplete" v-model="keyword" :fetch-suggestions="querySearchAsync"  @select="handleSelect">
</el-autocomplete>

  

相關文章