Bootstrap 选择错误:无法设置未定义的属性“_menu" [英] Bootstrap select error: Cannot set property '_menu' of undefined

查看:35
本文介绍了Bootstrap 选择错误:无法设置未定义的属性“_menu"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在 angular 5 中使用 bootstrap-select 实现了选择框.我使用了最新版本的 Bootstrap select 来使其在 angular 5 中工作.但它抛出以下错误.

I've implemented select box using bootstrap-select in angular 5. I've used latest version of Bootstrap select to make it work angular 5. But it throws below error.

bootstrap-select.js:1904 未捕获的类型错误:无法设置属性'_menu' 未定义

bootstrap-select.js:1904 Uncaught TypeError: Cannot set property '_menu' of undefined

<form>
     <select class="selectpicker" data-live-search="true">
         <option>Mustard</option>
         <option>Ketchup</option>
         <option>Relish</option>
     </select>
</form>

查看Plunkr

推荐答案

Bootstrap-select v1.13.0-dev 与 Boostrap 4 兼容.您可以在此处找到兼容的 bootstrap-select 文件 Boostrap-select

Bootstrap-select v1.13.0-dev is compatible with Boostrap 4. You can find Compatible bootstrap-select files here Boostrap-select

问题是我没有将所需的 jquery 和 popper.min.js 文件加载到项目目录中.还可以使用非缩小版的 bootstrap select from repository code.我通过添加上述文件解决了这个问题.

Isue is that i am not loading required jquery and popper.min.js files into project directory. Also use non minified version of bootstrap select from repository code. I've solved this issue by adding above files.

这篇关于Bootstrap 选择错误:无法设置未定义的属性“_menu"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆