简体   繁体   English

Bootstrap-vue 连接到 vue.js 但它不起作用

[英]Bootstrap-vue connect to vue.js but it's not work

enter image description here在此处输入图像描述

Uncaught TypeError: Cannot read property 'prototype' of undefined at eval (config.js?228e:6) at Module../node_modules/bootstrap-vue/esm/utils/config.js (chunk-vendors.js:6778) at webpack_require (app.js:849) at fn (app.js:151) at eval (props.js?cf75:1) at Module../node_modules/bootstrap-vue/esm/utils/props.js (chunk-vendors.js:7054) at webpack_require (app.js:849) at fn (app.js:151) at eval (model.js?58f2:1) at Module../node_modules/bootstrap-vue/esm/utils/model.js (chunk-vendors.js:6970)未捕获的类型错误:无法在模块../node_modules/bootstrap-vue/esm/utils/config.js (chunk-vendors.js:6778) 的 eval (config.js?228e:6) 处读取未定义的属性“原型” webpack_require (app.js:849) at fn (app.js:151) at eval (props.js?cf75:1) at Module../node_modules/bootstrap-vue/esm/utils/props.js (chunk-vendors .js:7054) 在webpack_require (app.js:849) 在 fn (app.js:151) 在 eval (model.js?58f2:1) 在 Module../node_modules/bootstrap-vue/esm/utils/model .js (块-vendors.js:6970)

I think it's connect with npm console:我认为它与 npm 控制台连接:

warning in./src/plugins/bootstrap-vue.js警告在./src/plugins/bootstrap-vue.js

"export 'default' (imported as 'Vue') was not found in 'vue' “在‘vue’中找不到导出‘默认’(导入为‘Vue’)

warning in./node_modules/bootstrap-vue/esm/vue.js警告在./node_modules/bootstrap-vue/esm/vue.js

"export 'default' (reexported as 'Vue') was not found in 'vue' “在‘vue’中找不到导出‘默认’(重新导出为‘Vue’)

You can install BootstrapVue in Vue CLI by:您可以通过以下方式在Vue CLI中安装BootstrapVue

  • Running the command npm i bootstrap-vue from your project's root .从项目的root运行命令npm i bootstrap-vue
  • Import it in your main.js file like so:将其导入您的main.js文件,如下所示:
import Vue from 'vue'
import App from './App.vue'

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

import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'

Vue.use(BootstrapVue)
Vue.use(BootstrapVueIcons)

new Vue({
  render: h => h(App),
}).$mount('#app')

You should be able to import & use BootstrapVue 's components now.您现在应该可以导入和使用BootstrapVue的组件了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM