一个灵活且快速的自动完成JavaScript库,可与本机输入字段一起使用。它从JS 数组中获取数据,并在您输入文本时在下拉列表中突出显示。主要特色支持本地和远程数据源。单选和多选。键盘辅助功能。数据排序和分组。在结果中突出显示匹配的字符。易于使用您自己的 CSS 进行自定义。定义数据源const myData = ['js', 'Java', 'PHP'],初始化插件new VanillaAutocompleter({ inputElement: document.querySelector('.ac_input'), suggestionsBoxElement: document.querySelector('.ac_suggestions'), data: myData });全部配置参数new VanillaAutocompleter({ // highlights matched characters highlight: false, // enables multiselect multiple: false, // shows the selected items showSelected: false, // shows all suggestions when the input is empty allOnEmpty: false, // shows the suggestion list when the input gets focus. showOnFocus: false, // enables keyboard accessibility arrowNav: false, // debounce delay in ms debounceDelay: 0, // functions inputValue: function(suggestion){ // ... }, suggestionHTML: function(suggestion){ // ... }, matchTarget: function(data){ // ... }, isMatch: function(value, data){ // ... }, group: function(suggestion){ // ... }, sort: function(){ // used to sort suggestions }, sortGroup: function(){ // used to sort groups }, });
文件目录······
暂无数据
猜你喜欢
更多»
项目推荐
更多»
PDF电子书
更多»
Java多线程编程核心技术
(2)
Linux命令详解词典.pdf
(5)
深入Python3中文版
(0)
百度SEO一本通.pdf
(0)
mysql必知必会.pdf
(2)
疯狂JAVA讲义 pdf电子书
(3)
C# 图解教程pdf电子书
(3)
研磨设计模式 pdf电子书
(0)