nativescript-vue / nativescript-vue-navigator

A simple router for NativeScript-Vue, built on top of $navigateTo to simplify routing from within components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't work on created()

jdinartejesus opened this issue · comments

I'm trying to redirect to a confirm-email page after login on the dashboard but doesn't work as expected. Currently navigates to confirm-email page but after returns to dashboard.

Eg.

// dashboard.vue
...
created () {
   this.$navigator.navigate('/confirm-email', { clearHistory: true })
}

Currently: Login -> Dashboard -> Confirm-Email -> Dashboard
Expected: Login -> Dashboard -> Confirm-Email

Thanks!

Unfortunately navigation can only happen when Frame/Pages are loaded - try using the loaded event and triggering a navigation from there.

Thanks @rigor789 , currently using if and else for this but loaded could be also a solution.