Hi
At times you want to perform something before a page enteres the UI. In most cases one will use the created (fetchData) and mounted (updateUI) life cycle events. However there is another gem, that is being explored in BVAD3, the beforeEnter router event. This happens before your page enteres.
1. You can check if a user is authenticated and if not navigate them to the login page. This is what the code above does.
2. Show a loading dialog (this has not been explored on time of this post)
3. Some other wishful things...
Have fun!
PS: All the b4xTemplates will be updated with this block of code, commented.
www.b4x.com
B4X:
Sub beforeEnter(boTo As Map, boFrom As Map, boNext As BANanoObject)
'the page we are going to
vuetify.SaveRoute(boTo, False)
'check authentication
If vuetify.Authenticated = False Then
'user is not authenticated, go to login page
vuetify.NavigateToNext(boNext, "login")
Return
End If
'continue navigation
vuetify.NavigateToNext(boNext, "")
End Sub
At times you want to perform something before a page enteres the UI. In most cases one will use the created (fetchData) and mounted (updateUI) life cycle events. However there is another gem, that is being explored in BVAD3, the beforeEnter router event. This happens before your page enteres.
1. You can check if a user is authenticated and if not navigate them to the login page. This is what the code above does.
2. Show a loading dialog (this has not been explored on time of this post)
3. Some other wishful things...
Have fun!
PS: All the b4xTemplates will be updated with this block of code, commented.
[BANanoVuetifyAD3] Create Professional Looking Vuetify WebSites & WebApps with BANano
Ola ************************************************** Feb 2024: BVAD3 RoadMap https://www.b4x.com/android/forum/threads/bananovuetifyad3-2024-roadmap.159326/ ************************************************* Download Additional Libraries Download BANanoVuetifyAD3Core Library OR Download...