Skip to content

AutoComplete 自动完成

基本用法

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

其他数据源用法

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-model绑定值string-
api查询数据源stringclearbit
query-delay查询数据延迟number500
placeholder输入占位符内容stringInput company name
clearable显示清除按钮booleantrue
backFill使用键盘选择选项的时候把选中项回填到输入框中booleantrue
popup-append-to-body是否插入至 body 元素上booleantrue
auto-focus自动获取焦点booleantrue
show-submit-button显示提交按钮booleantrue
submit-button-label提交按钮文字stringSubmit
offset-top距离文本框底部的偏移值number5
auto-flip文本框是否自动翻转booleanfalse
history-enabled打开保存历史记录booleantrue
history-type保存历史记录模式stringlocalStorage
history-storage-key保存历史记录键stringcompany-history
history-clearable显示历史记录清除按钮booleantrue

Events

NameDescriptionType
input当输入值改变时触发Function
change当输入值改变时触发Function
fetch查询数据时触发Function
abort-fetch当中止查询数据时触发Function
select当单击建议时触发Function
clear当单击文本框清除按钮时触发Function
focus当输入聚焦时触发Function
blur当输入取消聚焦时触发Function
submit按钮提交时触发Function
dropdown-visible-change当下拉菜单出现/消失时触发Function

本中文文档内容版权为 Michael Sun 所有,保留所有权利。