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>

猜你喜欢

转载自www.cnblogs.com/CryOnMyShoulder/p/10849417.html
今日推荐