[Vuejs]-Vue template not being displayed?

0👍

Try something like this;

<div id="sidenav">
    <SideNav></SideNav>
</div>

You “mount” your Vue instance to the root element with id #sidenav here:

var SideNav = new Vue({
    el: '#sidenav'
});

meaning, when you created your Vue component here: Vue.component('SideNav', require('./components/SideNav.vue'));, you have access to the <SideNav> tag within that root element.

Also, I’m not sure if you need the .default at the end of your Vue.component(...) creation.

Leave a comment