Error when using coreui with webpack and bootstrap admin template #354
Unanswered
geraldhanks
asked this question in
Q&A
Replies: 2 comments 2 replies
-
@geraldhanks Can you try this |
Beta Was this translation helpful? Give feedback.
2 replies
-
Don't use the inline onclick, just add some plain Javascript code in your app.js and add an event listener. It is another way of thinking but you almost never need the inline stuff. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have installed webpack into my project and have included coreui in my app.js file using "import '@coreui/coreui'". Webpack builds my javascript bundle but I seem to be missing something since I am getting an error when using the bootstrap admin template and trying to hide the sidebar with onclick="coreui.Sidebar.getInstance(document.querySelector('#sidebar')).toggle()"
The sidebar fails to toggle and my browser debugger shows that the variable 'coreui' cannot be found.
Any ideas on what I could be missing?
Beta Was this translation helpful? Give feedback.
All reactions