[Vuejs]-Components not loading into page upon path switch (Vue.js quasar framework)

0👍

I ended up fixing the problem in a way that is a bit hacky, but I use local storage to refresh the page.

load() {
  if( window.localStorage )
  {
    if( !localStorage.getItem('firstLoad') )
    {
      localStorage['firstLoad'] = true;
      window.location.reload();
    }  
    else
      localStorage.removeItem('firstLoad');
  }
}

0👍

After I set the children pages name it work as expected.

Your code:

const routes = [
  {
    path: '/', name:'Layout',
    component: () => import('layouts/MyLayout.vue'),
    children: [
      { path: '/', name:'Home', component: () => import('pages/PageUsers.vue') },
      { path: '/auth', name:'Auth', component: () => import('pages/PageAuth.vue') },
      { path: '/buttons', name:'Button', component: () => import('pages/PageButtons.vue') }
    ]
  }  
]

Leave a comment