【发布时间】:2020-12-11 23:26:29
【问题描述】:
我为此苦苦挣扎了几个小时,我似乎无法将 bootstrap-select 放在 livewire 组件中工作,所以我将尝试具体说明我的情况,并希望有人可以帮助我。我有一个使用this adminlte 的 laravel 项目,所以我的代码是:
web.php
Route::livewire('/new','new')->layout('adminlte::page');
然后,我有我的 页面 A,其中包含 livewire 组件,顺便说一句,它是一个引导模式。
@livewire('new')
在我的 app.scss 中:(我使用 npm 安装了引导选择)
// Bootstrap
@import '~bootstrap/scss/bootstrap';
@import '~bootstrap-select/sass/bootstrap-select.scss';
在我的 app.js 中,我有:
require('./bootstrap');
require('../../node_modules/bootstrap-select/dist/js/bootstrap-select');
在此之后,我转到我的 livewire 刀片文件并尝试使用示例“选择/取消选择所有选项:
<select class="selectpicker" multiple data-actions-box="true">
<option>Mustard</option>
<option>Ketchup</option>
<option>Relish</option>
</select>
但是什么也没发生,所以我发现了this 链接并使用了给出的解决方案,但结果是一样的。
谁能指出我正确的方向?我只是不知道我错过了什么,我也尝试了其他链接,但如果我把所有东西都放在这里,这将是一个很长的问题。
感谢您的宝贵时间
【问题讨论】: