【发布时间】:2017-02-14 23:48:41
【问题描述】:
我在 Laravel 5.3 中使用 https://github.com/bassjobsen/Bootstrap-3-Typeahead。
我之前使用的是 twitter 版本,效果很好,只是样式被破坏了。所以我切换到这个版本,但下拉菜单没有被渲染。控制台中也没有错误。
如果我在开发工具中打开网络选项卡,我可以看到正在发出请求并且正在成功返回数据。它只是不呈现建议下拉框。
有人知道为什么会这样吗?
<input type="text" id="search" data-provide="typeahead" autocomplete="off">
var engine = new Bloodhound({
remote: {
url: '/find?q=%QUERY%',
wildcard: '%QUERY%'
},
datumTokenizer: Bloodhound.tokenizers.whitespace,
queryTokenizer: Bloodhound.tokenizers.whitespace
});
engine.initialize();
$("#search").typeahead({
hint: true,
highlight: true,
minLength: 0,
source:engine.ttAdapter()
});
【问题讨论】:
-
你有什么错误吗?
-
@SaravananSampathkumar 见帖子 - “控制台中也没有错误。”
-
你可以在这里发布你的示例 json 响应吗?
标签: laravel twitter-bootstrap-3 bootstrap-typeahead