bootstrap-select 与bootstrap 4兼容性问题 Cannot set property '_menu' of undefined
bootstrap-select默认只支持bootstrap 3+
支持4.0需要额外引入一个popper.js文件
bootstrap官网有解释:
https://getbootstrap.com/docs/4.1/getting-started/introduction/
翻译如下:
引入顺序如下即可。
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
假如以上方法还没解决。
经过逐一调试发现。
bootstrap4.0仍然无法兼容bootstrap-select,需要将bootstrap4.0改成4.1.3版本即可
本文来自博客园,作者:迷神图卷,转载请注明原文链接:https://www.cnblogs.com/CryOnMyShoulder/p/10849417.html