gpt4 book ai didi

typeahead.js - typeahead 空模板不工作

转载 作者:行者123 更新时间:2023-12-01 23:51:44 26 4
gpt4 key购买 nike

我正在这样设置 typeahead:

       $this.typeahead({ 
prefetch: $this.data('url-prefetch'),
templates: {
empty: 'No matching files found'
}
})

预取工作正常,但在没有匹配项时不会显示空模板。

最佳答案

遇到这个问题的人:

如果选项中有 {async:true},“空”模板将不会显示

$this.typeahead({
async: false,
prefetch: $this.data('url-prefetch'),
templates: {
empty: 'No matching files found'
}
});

关于typeahead.js - typeahead 空模板不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26029039/

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