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.
- [Vuejs]-Creating Vuex getters dynamically from database data
- [Vuejs]-Computed property doesn't kick in, Vue js
Source:stackexchange.com