Bootstrap 4 Beta importing Popper.js with Webpack 3.x throws Popper is not a constructor

前端 未结 5 524
滥情空心
滥情空心 2020-12-28 17:32

So Bootstrap 4 Beta is out... yey! However Tether has been replaced by Popper.js for tooltip (and other features). I saw an error thrown in the con

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-28 18:13

    If you are using Webpack Do this:

    window.$ = window.jQuery = require('jquery');
    window.Popper = require('popper.js').default; // pay attention to "default"
    require('bootstrap/dist/js/bootstrap');
    

提交回复
热议问题