Skip to content

AutoComplete

Basic Usage

vue
<autocomplete v-model="value" />

Data Source Usage

vue
<autocomplete
  v-model="value"
  api="qcc_open"
  history-storage-key="qcc-open-company-history"
  :auto-focus="false"
  submit-button-label="查一查"
  placeholder="请输入企业名称或统一社会信用代码"
/>

API

Attributes

NameDescriptionTypeDefault
v-modelbinding valuestring-
apiquery sourcestringclearbit
query-delayquery delaynumber500
placeholderinput placeholder contentstringInput company name
clearableshow clear buttonbooleantrue
backFillIf backFill selected item the input when using keyboardbooleantrue
popup-append-to-bodywhether to append Dialog itself to bodybooleantrue
auto-focusauto focusbooleantrue
show-submit-buttonshow submit buttonbooleantrue
submit-button-labelsubmit button labelstringSubmit
offset-toppixels to offset from input bottomnumber5
auto-flipauto flipbooleanfalse
history-enabledopen save history recordbooleantrue
history-typesave history record modestringlocalStorage
history-storage-keysave history record keystringcompany-history
history-clearableshow history clear buttonbooleantrue

Events

NameDescriptionType
inputtriggers when the input value changeFunction
changetriggers when the input value changeFunction
fetchtriggers when query dataFunction
abort-fetchtriggers when abort query dataFunction
selecttriggers when a suggestion is clickedFunction
cleartriggers when the input is cleared by clicking the clear buttonFunction
focustriggers when the input focusesFunction
blurtriggers when the input blursFunction
submittriggers when the button submitFunction
dropdown-visible-changetriggers when the dropdown appears/disappearsFunction

Released under the MIT License.