codex6424
02/28/2023, 5:31 PM/dashboard
to be accessible only when the user is logged in.
How to do it?
I'm making a VueJS + Express app.snackdex
02/28/2023, 7:51 PMsnackdex
02/28/2023, 7:51 PMsnackdex
02/28/2023, 7:52 PMcodex6424
02/28/2023, 10:26 PM/dashboard
to be a frontend route, I need to create Dashboard.vue, dashboardView.html and add DashboardView component to router\index.ts
, right?codex6424
02/28/2023, 10:27 PMsnackdex
02/28/2023, 10:47 PMsnackdex
02/28/2023, 10:47 PMsnackdex
02/28/2023, 10:47 PMsnackdex
02/28/2023, 10:48 PMconst router = createRouter({ ... })
router.beforeEach((to, from) => {
// ...
// explicitly return false to cancel the navigation
return false
})
snackdex
02/28/2023, 10:48 PMsnackdex
02/28/2023, 10:49 PMsnackdex
02/28/2023, 10:50 PMcodex6424
03/01/2023, 12:39 PM