[SOLVED] Framework7 vue beforeEnter loggedin

I do not understand how to do it. Please show the work code

enter index page
if loggedin = true
show index page
redirect to login page

enter login page
if loggedin = true
redirect to index page
show login page


I tried, does not work. Please show me an example.

Show your code with async

routes = [
path: ‘/’,
async(routeTo, routeFrom, resolve, reject) {
if (true) {
resolve({ url: ‘/’ })
} else {
resolve({ url: ‘/login/’ })

Does not work

URL must be link to conponent url

Show an example please, otherwise I’m completely confused

problem solved thanks