I've been working on integrating Bootstrap 5 into my Nuxt project
.
While the styles are coming through perfectly, anything that previously relied on jQuery
is not functioning as expected.
The steps I followed for installation:
Downloaded files from the Bootstrap download page
Set up
/css
and/js
folders within the asset directoryMoved
bootstrap.css
to the/css
folder andbootstrap.min.js
to the/js
folderAdded configuration settings to the
nuxt.config.js
file:
css: [
'@/assets/css/bootstrap.css'
],
js: [
'@/assets/js/bootstrap.min.js'
],
- Refreshed the site multiple times.
This is a code snippet I'm testing directly from the Bootstrap components documentation:
// 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>