在 Bootstrap 3 RC 1中的 type-head JavaScript 模块在哪里?

正如你所知道的,Bootstrap RC 1就在这里,我已经阅读了关于这个新框架中所有新的令人敬畏的特性。但你猜怎么着,文件里没有打字机了。有人知道这是出于什么原因吗?

我在谷歌搜索的时候发现了 这些例子,而且我也读到了 在这个职位,他们改变了字体 Bootstrap。所以我必须手动添加它还是它也在 Bootstrap 3包中?

有人知道这件事吗?

82680 次浏览

I believe it has been deprecated in favor of Twitter's excellent typeahead.js. Their documentation has a Bootstrap integration section that should help.

edit: Twitter has removed the integration instructions. It's not clear if this is temporary in advance of a Bootstrap 3.0-compatible release or if it's gone for good, but @drye links to a useful replacement at http://www.aureliomerenda.com/install-typeahead-bootstrap-3-fix-css-overlay-width-100/.

As ceejayoz already stated, you need the typeahead.js + the additional CSS for integrate with Bootstrap.

This is made for Bootstrap 2.

If you want it to work with Bootstrap 3, you have to change the .tt-hint class. I changed it to display: none; because it overlayed very terrible.

I also noticed that Button addons (to inputs) don't work that well because the input gets not correctly overridden too.

Yes, typeahead is deprecated in Bootstrap 3.

But typeahead.js is not ready for Bootstrap 3.

The working solution is to add the additional css, which repairs the css problems: https://github.com/jharding/typeahead.js-bootstrap.css

Now that the final Bootstrap 3.0.0 has been released, the typeahead has been officially removed. However, Twitter's Typeahead (https://github.com/twitter/typeahead.js) can be used in it's place:

Bootstrap 3 Typeahead example: http://bootply.com/86571

I found the adaption [may 2014] ;)

for others landing here from google like I did, still searching for the right answer: https://github.com/bassjobsen/Bootstrap-3-Typeahead

and if you need it working with knockout 3 like I do, I adapted the code from the genius Niemeyer ( https://stackoverflow.com/a/20503173/1218136 ) minimally to work again:

<input type="text" data-bind="value: value, typeahead: {source: your_array}" />