I am pretty confused on how to make the Javascript utilities in Bootstrap 4 work.
I am using ES2015 style requires. I've installed jQuery, the latest beta of Bootstrap 4 (beta 2) and Popper.js using node modules. Here's how I am loading my JS:
window.$ = window.jQuery = require('jquery');
$(function() {
require('popper');
require('./vendor/bootstrap/index');
});
Popper's docs state that you need code like this to instantiate Popper:
var reference = document.querySelector('#dropdownLanguageButton');
var popper = document.querySelector('div[aria-labelledby="dropdownLanguageButton"]');
var anotherPopper = new Popper(
reference,
popper,
{
// popper options here
}
);
However, it is not clear if you need to instantiate for something as simple as a Bootstrap dropdown.
There is no clear example in the Bootstrap 4 docs.
The error I am getting is index.js:10 Uncaught ReferenceError: Popper is not defined
.
Help appreciated!
Maybe problem in path to popper.js. Popper's required file located in 'node_modules/popper.js/dist/umd/popper.min.js'
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.