【问题标题】:BootstrapVue in VueJS 3VueJS 3 中的 BootstrapVue
【发布时间】:2022-11-01 15:10:18
【问题描述】:

我正在尝试在我的 Vue-JS 3 项目中使用 bootstrap-vue,但出现错误

使用 npm 运行服务

在我的浏览器中我得到了

浏览器上的错误

我在终端中使用了这个命令

npm install vue bootstrap bootstrap-vue

这是我的 main.js 代码

import { createApp } from 'vue'
import App from './App.vue'

import { BootstrapVue, IconsPlugin } from 'bootstrap-vue'

// Import Bootstrap and BootstrapVue CSS files (order is important)
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'

createApp(App).use(BootstrapVue).use(IconsPlugin).mount('#app')

任何人都知道如何解决它?我看到是因为从 Vue 2 到 3 发生了一些变化,但是我看到 Vue JS 3 中的一个项目已经使用引导程序运行,所以我猜这个 bug 已经修复

【问题讨论】:

  • 来自 BootstrapVue 网站:“需要 Vue.js v2.6,建议使用 v2.6.12。”它不支持 Vue 3。
  • 哦,好的,谢谢,我会尝试使用 VueJS 2 所以

标签: vue.js vuejs3 bootstrap-vue


【解决方案1】:

问题:Bootstrap-Vue 尚不兼容 Vue.js 3。

【讨论】:

    【解决方案2】:

    https://cdmoro.github.io/bootstrap-vue-3/

    使用它没有完全发布但效果很好,我在几个项目中使用它

    干杯

    【讨论】:

      猜你喜欢
      • 2020-04-15
      • 2022-01-05
      • 2021-11-21
      • 2019-06-14
      • 2018-08-13
      • 2019-12-27
      • 1970-01-01
      • 2021-09-15
      相关资源
      最近更新 更多