Autocomplete Algolia自动完成问题
我有以下搜索代码:Autocomplete Algolia自动完成问题,autocomplete,algolia,Autocomplete,Algolia,我有以下搜索代码: autocomplete('#search-input', {hint: false, autoselect: true}, [ { source: autocomplete.sources.hits(contacts, { hitsPerPage: 3 }), displayKey: 'CustomerName', templates: {
autocomplete('#search-input', {hint: false, autoselect: true}, [
{
source: autocomplete.sources.hits(contacts, { hitsPerPage: 3 }),
displayKey: 'CustomerName',
templates: {
header: '<div class="leftMargin5"><b>Contacts</b></div>',
suggestion: function(hit) {
return templateContact.render(hit);
}
}
},
{
source: autocomplete.sources.hits(products, { hitsPerPage: 5 }),
displayKey: 'ProductDescription',
templates: {
header: '<div class="leftMargin5"><b><Products</b></div>',
suggestion: function(hit) {
return templateProduct.render(hit);
}
}
}
]).on('autocomplete:selected', function (event, suggestion, dataset) {
//DoSomething
}).on('autocomplete:autocompleted', function (event, suggestion, dataset) {
//DoSomething
});
autocomplete(“#搜索输入”,{hint:false,autoselect:true}[
{
来源:autocomplete.sources.hits(联系人,{hitsPerPage:3}),
displayKey:“CustomerName”,
模板:{
标题:“联系人”,
建议:功能(hit){
返回templateContact.render(命中);
}
}
},
{
来源:autocomplete.sources.hits(产品,{hitsPerPage:5}),
displayKey:'ProductDescription',
模板:{
标题:“Arg确实,这是autoselect
和displayKey
选项之间的一个错误。您可以删除displayKey
来解决问题,您应该在上打开一个问题
更新:自0.21.6
Arg以来,这一问题已得到修复。事实上,这是自动选择
和显示键
选项之间的一个错误。您可以删除显示键
来解决此问题,您应该在上打开一个问题
更新:自0.21.6
以来,此问题已得到解决。您能创建一个小提琴吗?这将帮助我们为您提供很多帮助。您能创建一个小提琴吗?这将帮助我们为您提供很多帮助。