Tag: 远程服务器

用血猎犬远程建议预先输入

这是我的代码: tagsProcessor(){ const suggestions = [{value: ‘string1’}, {value: ‘string2’}, {value: ‘string3’}, {value: ‘string4’}, {value: ‘string5’}] var bloodhoundSuggestions = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace(‘value’), queryTokenizer: Bloodhound.tokenizers.whitespace, sufficient: 3, local: suggestions, remote: { url: ‘http://localhost:3001/api/suggestions’, } }); const $tagsInput = $(‘#tagsInput’) $tagsInput.typeahead({ hint: true, highlight: true, minLength: 1 }, { name: ‘suggestions’, displayKey: ‘value’, source: bloodhoundSuggestions }); } […]