简体   繁体   English

获取引导程序提前输入参数

[英]Get bootstrap typeahead parameters

I simply want to get the "minLength" parameter of a typeahead control anywhere in my code. 我只是想在我的代码中的任何地方获取预先输入控件的“ minLength”参数。

How can I do this? 我怎样才能做到这一点?

The controle is defined like this: 控件的定义如下:

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

you can try this 你可以试试这个

var options = {
  hint: true,
  highlight: true,
  minLength: 3
}

$('#typeahead').typeahead(options)
// and to get the minLength just use options.minLength
console.log(options.minLength);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM