Skip to content

AutoComplete 自动生成

规则

js
{
    type: "autoComplete",
    title: "自动完成",
    field: "auto",
    value: "xaboy",
    props: {
    	fetchSuggestions: function (queryString, cb) {
			cb([
				{value: queryString}, {value: queryString + queryString}
			]);
		}
	}
}
{
    type: "autoComplete",
    title: "自动完成",
    field: "auto",
    value: "xaboy",
    props: {
    	fetchSuggestions: function (queryString, cb) {
			cb([
				{value: queryString}, {value: queryString + queryString}
			]);
		}
	}
}

参考:Element_AutoComplete

value :String

Props

参数说明类型可选值默认值
placeholder输入框占位文本string
disabled禁用booleanfalse
valueKey输入建议对象中用于显示的键名stringvalue
debounce获取输入建议的去抖延时number300
placement菜单弹出位置stringtop / top-start / top-end / bottom / bottom-start / bottom-endbottom-start
fetchSuggestions返回输入建议的方法,仅当你的输入建议数据 resolve 时,通过调用 callback(data:[]) 来返回它Function(queryString, callback)
popperClassAutocomplete 下拉列表的类名string
triggerOnFocus是否在输入框 focus 时显示建议列表booleantrue
name原生属性string
selectWhenUnmatched在输入没有任何匹配建议的情况下,按下回车是否触发 select事件booleanfalse
label输入框关联的label文字string
prefixIcon输入框头部图标string
suffixIcon输入框尾部图标string
hideLoading是否隐藏远程加载时的加载图标booleanfalse
popperAppendToBody是否将下拉列表插入至 body 元素。在下拉列表的定位出现问题时,可将该属性设置为 falseboolean-true

Events

事件名称说明回调参数
select点击选中建议项时触发选中建议项

Released under the MIT License.