javascript 如何使用bootstrap 5运行Bootstrap-select而不出现此错误

yeotifhr  于 2023-02-11  发布在  Java
关注(0)|答案(1)|浏览(264)

我正在一个项目上使用Bootstrap 5(基于模板),当我尝试包含bootstrap-select(版本1.13.14)时,控制台返回以下错误:
未捕获的类型错误:无法读取未定义的属性(读取"构造函数")----bootstrap-select. js:3133
这一行是:

// get Bootstrap's keydown event handler for either Bootstrap 4 or Bootstrap 3
var bootstrapKeydown = $.fn.dropdown.Constructor._dataApiKeydownHandler || $.fn.dropdown.Constructor.prototype.keydown;

因此,具有类selectpicker的select元素不会显示。
有什么想法吗?谢谢!

z4iuyo4d

z4iuyo4d1#

好吧...解决它使用bootstrap-select版本1.14-beta.找到答案在这个线程:https://github.com/snapappointments/bootstrap-select/issues/2439
但请注意,这是一个测试版。

相关问题