As a newcomer to developing applications with Nuxt.js, I am currently working on building a web application using Nuxt.js and Vue.js. In the process of setting up my project with the Nuxt CLI, I decided to include Bootstrap-vue. However, I encountered issues while trying to create a Bootstrap modal, prompting me to remove Bootstrap-vue entirely from my application and revert to plain old Bootstrap.
Despite following some answers provided online for removing Bootstrap-vue and adding Bootstrap, I am still facing problems. It seems that I have not successfully removed Bootstrap-vue and integrated Bootstrap properly into my project, as I am experiencing display issues with modals and dropdowns.
If anyone could assist by pointing out any missed steps or errors in my workflow, it would be greatly appreciated:
** Removal of Bootstrap-vue ***
npm i bootstrap-vue --save
.- Remove the
bootstrap-vue.js
file from theplugins
folder. - Eliminate the plugin reference from
nuxt-config.js
:plugins: ["@/plugins/bootstrap-vue"],
** Installing plain old Bootstrap **
I added the following CDN links to my nuxt-config.js
file:
script: [
{
src: "https://code.jquery.com/jquery-3.6.0.min.js"
},
{
src:
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
}
]
link:[
{
rel: "stylesheet",
href:
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
},
{
rel: "stylesheet",
href:
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css"
}]
After making these adjustments, attempts to create a simple modal using Bootstrap and add a dropdown within it result in nothing being displayed within the modal.
Could someone please verify whether I am following the correct workflow or if there are missing components? Any guidance or suggestions would be immensely helpful.
*** UPDATED ***
Here is an excerpt from my nuxt-config.js
file:
...
In addition, this snippet represents the contents of my plugins/bootstrap-vue.js
:
import Vue from 'vue'
import BootstrapVue from 'bootstrap-vue'
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
Vue.use(BootstrapVue)
Lastly, here is the code pertaining to the modal:
...