const showNavbar = computed(() => route.name !== 'dashboard' && route.name !== 'dashboard_home' && route.name !== 'displa" /> const showNavbar = computed(() => route.name !== 'dashboard' && route.name !== 'dashboard_home' && route.name !== 'displa" /> const showNavbar = computed(() => route.name !== 'dashboard' && route.name !== 'dashboard_home' && route.name !== 'displa"/>

Why I am still seeing the Navbar on /dashboard page?

31 Views Asked by At
<Navbar v-if="showNavbar" /> 

const showNavbar = computed(() => 
  route.name !== 'dashboard' &&
  route.name !== 'dashboard_home' &&
  route.name !== 'display' &&
  route.name !== 'modify' &&
  route.name !== 'password' 
);

Above is the code for computed property to not show the Navbar on the mentioned-pages. But the problem is I am still seeing the Navbar on my dashboard page.

Here is the code of routes for my dashboard.

{path: '/dashboard', name: 'dashboard', component: ApplicationShell, meta: { requiresAuth: true},
        children: [
            { path: '', name: 'dasboard_home',component: dashboard_home },
            { path: 'display', name: 'display', component: display_personal_data },
            { path: 'modify', name: 'modify', component: modify_personal_data },
            { path: 'password', name: 'password', component: password },
          ]
            }
1

There are 1 best solutions below

0
David Fox On

Typo. I see showNavbar is checking if the current route name is not equal to 'dashboard', 'dashboard_home', 'display', 'modify', or 'password'. But in your route configuration, the name for the dashboard home route is 'dashboard_home', not 'dasboard_home'.

            { path: '', name: 'dasboard_home',component: dashboard_home },