首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用标记数组进行Typeahead

使用标记数组进行Typeahead
EN

Stack Overflow用户
提问于 2013-09-10 03:26:49
回答 1查看 458关注 0票数 2

我正在使用Typeahead并尝试添加一个标记数组。

看小提琴:我输入“天文学a”,一切都很好。在我将下一个字符"n“添加到”天文学an“之后,typeahead确定不再有匹配项。

当我注释掉这两个标记行时,它将匹配整个字符串“天文学和物理”。

我不知道我到底做错了什么。

JsFiddle上的完整示例:http://jsfiddle.net/sr4136/qkZEx/

代码语言:javascript
复制
var json=[
    {
    "name":"Astronomy and Physics",
    "tokens":["astronomy and physics", "testwords", "something"]
    },
    {
    "name":"another thing",
    "tokens":["mer", "words", "word space"]
    }
];

$(".programs-search .text").typeahead([{
    name: 'programs',
    local: json,
    limit: 10,
    minLength: '3',
    valueKey: 'name'
}]);
EN

回答 1

Stack Overflow用户

发布于 2013-09-20 03:02:00

您只能在标记中使用单个单词。没有短语。

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18705480

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档