Bootstrap4 reports an error using the drop-down menu

problem:

Calling the drop-down menu with js in Bootstrap4, the error will be reported as follows:

The reason is that there is no Popper.js, we can import it.

 

Solution:

1. Download node

2. Open the command line to the specified directory, use npm to import, npm install --save Popper.js.

3. Introduce Popper.js into the HTML document, the structure directory of the Popper just downloaded should be like this:

You should import: node_modules \ popper.js \ dist \ umd \ popper.js

4. You must put popper.js on top of bootstrap.js, like this:

 

Guess you like

Origin www.cnblogs.com/py-peng/p/12758395.html