在NUXT3中导入Bootstrap-vue不起作用(使用nuxt.config.ts)

发布于 2025-02-08 09:35:26 字数 737 浏览 1 评论 0原文

我遵循了良好的步骤,创建了一个基于NUXT3的网站:

好,除了安装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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文