我想在我的Polymer项目中使用Materialize.css autocomplete.
控制台日志:
Uncaught TypeError: $(...).autocomplete is not a function
我的代码:
<div class="input-field">
<input type="text" id="assemp" class="autocomplete" value="{{emps::input}}">
<label for="assemp">Assigned Employee(s)</label>
</div>
脚本:
attached : function() {
$('input.autocomplete').autocomplete({
data: {
"Apple": null,
"Microsoft": null,
"Google": 'http://placehold.it/250x250'
}
});
}
最佳答案:
$(document).ready(function () {$('input.autocomplete').autocomplete({
data: {
"Apple": null,
"Microsoft": null,
"Google": null
}});});