根據(jù)BootstrapVue官方介紹,手寫需要安裝bootstrap-vue依賴,但是官方?jīng)]有說明其需要依賴jQuery,以及postcss,以及postcss-loader,所以也必須安裝jQuery。
1、安裝bootstrap-vue、jQuery、postcss、postcss-loader
yarn add bootstrap-vue
yarn add jquery
yarn add postcss
yarn add postcss-loader
2、在nuxt.config.js中配置使用bootstrap-vue
module.exports = {
modules: ['bootstrap-vue/nuxt']
}
之后引入UI組件既可以使用。