提问人:Megan Clerc 提问时间:3/7/2023 最后编辑:Megan Clerc 更新时间:3/7/2023 访问量:29
为什么预输入不显示结果?
Why typeahead does not show results?
问:
我使用这个插件。
HTML 元素为:
<input class="form-control typeahead" maxlength="50" id="secondname" required="required" name="secondname" type="text">
$("#secondname").typeahead({
minLength: 3,
async: true,
source: function (query, process) {
return fetchPatientForm({ secondname: query })
.then((res) => res.data)
.then((data) => {
console.log(data);
return process(data);
});
},
});
响应
console.log(data);
是:
[{id: 39, name: 'Михаил', secondname: 'Попов', patronymic: '3' }];
所以也没有错误和结果。我做错了什么?
我试图从服务器返回普通数组,例如 [1, 2, 3] 它也不起作用
答: 暂无答案
评论