Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/409.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript typeahead-minLength触发建议列表_Javascript_Typeahead.js_Bloodhound - Fatal编程技术网

Javascript typeahead-minLength触发建议列表

Javascript typeahead-minLength触发建议列表,javascript,typeahead.js,bloodhound,Javascript,Typeahead.js,Bloodhound,我将minLength设置为3,以在至少输入3个字符时触发建议列表 但当输入1个字符时,下拉列表将打开。如何做到这一点 $('#remote .typeahead').typeahead(null, { name: 'best-pictures', display: 'value', source: bestPictures, minLength: 3 }); 小提琴: 根据这里的文档-,第一个参数是options,不能为空 将其更改为following,它应该可以工作 $('

我将minLength设置为3,以在至少输入3个字符时触发建议列表

但当输入1个字符时,下拉列表将打开。如何做到这一点

$('#remote .typeahead').typeahead(null, {
  name: 'best-pictures',
  display: 'value',
  source: bestPictures,
  minLength: 3
});
小提琴:

根据这里的文档-,第一个参数是options,不能为空

将其更改为following,它应该可以工作

$('#remote .typeahead').typeahead({minLength: 3}, {
  name: 'best-pictures',
  display: 'value',
  source: bestPictures,
});