在NUXT3中导入Bootstrap-vue不起作用(使用nuxt.config.ts)
好,除了安装Visual Studio代码:D的部分。
网站工作后,我尝试在此处添加bootstrap-vue,此处: https://bootstrap-vue.org/docs#nuxtjs-module
带有NPM的引导程序使我感到惊讶,但我无法通过NUXT.Config.ts将其添加到项目中。 据我所知,该文件在过去的发行版中被称为nuxt.config.js,与基于新的打字稿的版本不同。
要导入Bootstrap,我尝试了以下NUXT.Config.ts文件:
import { defineNuxtConfig } from 'nuxt'
export default defineNuxtConfig({
modules: [
'bootstrap-vue/nuxt'
]
})
可悲的是,当我尝试添加Bootstrap按钮(b-button)时,错误将显示该组件未知。 让我希望采用基于PHP的方法,其中需要全部导入: - |。
有人知道问题所在吗?
I followed the getting strated steps to create a nuxt3 based website:
https://v3.nuxtjs.org/getting-started/quick-start/
Well, except the part about installing visual studio code :-D.
After the site was working I tried adding Bootstrap-vue following the guide here:
https://bootstrap-vue.org/docs#nuxtjs-module
I manged to get the bootstrap stuff with npm which suprised me, but I cannot add it to the project via the nuxt.config.ts.
As far as I can tell, this file was called nuxt.config.js in past releases and differs from the new typescript based one.
To import bootstrap I have tried the following nuxt.config.ts file:
import { defineNuxtConfig } from 'nuxt'
export default defineNuxtConfig({
modules: [
'bootstrap-vue/nuxt'
]
})
Sadly, when I try to add a bootstrap button (b-button) an error will show, that the component is unknown.
Makes me wish for a php based approach where an import is all that is needed :-|.
Does anyone have any idea where the problem is?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论