gpt4 book ai didi

javascript - Bootstrap 选择器显示 :Uncaught TypeError: Cannot set property '_menu' of undefined

转载 作者:行者123 更新时间:2023-12-04 08:18:29 25 4
gpt4 key购买 nike

我正在使用 bootstrap 选择器,但是每当我单击下拉列表时,它都会显示一些错误并且我无法执行数据实时搜索,即使我更改了 bootstrap 版本但对我不起作用
链接:

<link rel="stylesheet" type="text/css" href="<?= base_url('assets/') ?>app-assets/css/bootstrap.css">    // Bootstrap v4.0.0-alpha.4

<link rel="stylesheet" href="<?= base_url() ?>assets/selectpicker/bootstrap-select.min.css"> // Bootstrap-select v1.13.12
<script src="<?= base_url('assets/') ?>app-assets/js/jquery.min.js"></script> // jQuery v3.3.1
<script src="<?= base_url() ?>assets/selectpicker/bootstrap-select.min.js"></script> // Bootstrap-select v1.13.12

<script src="<?= base_url('assets/') ?>app-assets/js/core/libraries/bootstrap.min.js" type="text/javascript"></script> // Bootstrap v4.0.0-alpha.5
带有数据实时搜索的下拉列表
<select class="selectpicker" data-live-search="true" data-hide-disabled="true" name="user" id="user">
<option value=''>option 1</option>
<option value=''>option 2</option>
<option value=''>option 3</option>
<option value=''>option 4</option>
<option value=''>option 4</option>


</select>
错误:
未捕获的类型错误:无法在 bootstrap-select.min.js 中设置未定义的属性“_menu”

最佳答案

尝试使用 CDN 链接代替 Bootstrap。他们工作得很好!

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<title>Document</title>
</head>
<body>
<select
class="selectpicker"
data-live-search="true"
data-hide-disabled="true"
name="user"
id="user"
>
<option value="">option 1</option>
<option value="">option 2</option>
<option value="">option 3</option>
<option value="">option 4</option>
</select>

<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
</body>
</html>

关于javascript - Bootstrap 选择器显示 :Uncaught TypeError: Cannot set property '_menu' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65598633/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com