获取引导预类型参数

Get bootstrap typeahead parameters

本文关键字:类型参数 获取      更新时间:2023-09-26

我只想在我的代码中的任何位置获取预类型控件的"minLength"参数。

我该怎么做?

控件定义如下:

$('#typeahead').typeahead({
  hint: true,
  highlight: true,
  minLength: 3
},
....

你可以试试这个

var options = {
  hint: true,
  highlight: true,
  minLength: 3
}
$('#typeahead').typeahead(options)
// and to get the minLength just use options.minLength
console.log(options.minLength);