I am trying to implement Bootstrap 5 into my Nuxt project.
The styles work fine but anything that used-to use jQuery doesn't work.
My installation process:
Download files from the Bootstrap download page
Create
/cssand/jsfolders and move into asset folderPut
bootstrap.cssinto/cssfolder andbootstrap.min.jsinto/jsfolderAdd configuration to the
nuxt.config.jsfile:
css: [
'@/assets/css/bootstrap.css'
],
js: [
'@/assets/js/bootstrap.min.js'
],
- Refresh the site a dozen times.
This is the code I am testing taken straight from the Bootstrap component site:
// index.vue
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown button
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
</ul>
</div>