gpt4 book ai didi

jquery - 使用标记数组进行预输入

转载 作者:行者123 更新时间:2023-12-01 06:10:30 24 4
gpt4 key购买 nike

我正在使用 Typeahead 并尝试添加 token 数组。

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

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

我一生都不知道自己做错了什么。

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

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'
}]);

最佳答案

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

关于jquery - 使用标记数组进行预输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18705480/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com