I'm trying to add mmenu.js to a Laravel 8 project. I've installed it using NPM, but I'm having trouble including it in the project.
Right now, in bootstrap.js I have this:
import Mmenu from 'mmenu-js';
window.Mmenu = Mmenu;
There's no detailed documentation on the site for how to install on Laravel, so any help would be appreciated!
You can include in your project by writing code in the head section of page. Following is the example to put menu in your project.
<link href="path/to/css/mmenu.css" rel="stylesheet" />
<script src="path/to/js/mmenu.js"></script>
<!-- Fire the plugin -->
<script>
document.addEventListener(
"DOMContentLoaded", () => {
new Mmenu( "#my-menu" );
}
);
</script>