[SOLVED] Vue+F7: Best way to load new page in main view via router.navigate?

In links you can set view="#targetView", and using that link will open the destination in the target view.

But looking at https://framework7.io/vue/navigation-router.html, and https://framework7.io/docs/view.html#router-api-methods-properties, there is no .navigate option that points to a view, and I find that rather odd.

Anyway, for now I’m doing this.$f7.view[0].router.navigate(... as that is the main view, but that smells bad.

What is the best way to use .navigate to target a view?

1 Like

view1.router.navigate();

But from the context of another view? Say you are in a side-panel’s “methods” area, is there a better way than $f7.view[0] to get the “main-view’s router”?

app.views.view1.router ?

turns out that this.$f7.views.main.router.navigate(... works quite well. That ‘views’ object is an array AND has proprties. Fun! :slight_smile:

2 Likes