简体   繁体   中英

How To Include Popper.js In Vue Project For Bootstrap 4

Anybody know how to require popper.js in vue? I am importing it in my main.js file but no luck. here is the set up

import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import bootstrap from 'bootstrap'
import jQuery from 'jquery'
import Popper from 'popper'
global.jQuery = jQuery;
global.Popper = Popper;

Vue.config.productionTip = false

Vue.use(bootstrap);

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

and I have it installed according to package.json

"dependencies": {
    "bootstrap": "^4.1.3",
    "jquery": "^3.3.1",
    "popper": "^1.0.1",
    "vue": "^2.5.17",
    "vue-router": "^3.0.1",
    "vuex": "^3.0.1"
  },

So I uninstalled. And then re-installed the packages and it seems to work fine now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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