nativescript-vue / nativescript-vue-navigator

A simple router for NativeScript-Vue, built on top of $navigateTo to simplify routing from within components
MIT License
98 stars 10 forks source link

Multiple navigators doesn't work #80

Open butaminas opened 3 years ago

butaminas commented 3 years ago

My stack:

✔ Component nativescript has 7.2.0
✔ Component @nativescript/core has 7.3.0
✔ Component @nativescript/ios has 7.2.0
✔ Component @nativescript/android has 7.0.1
 

First of all, I think the docs on how to use Multiple navigators are misleading.

Vue doesn't support multiple root elements and since we are using Nativescript-vue rather than Vue, there should be more info on how to properly use this.

my app.js looks like this:

import Root from './components/experimental/Root'

new Vue({
    render: h => h(Root),
    store
}).$start();

In the Root.vue I've tried wrapping navigators in Page Frame and many more tags but nothing seems to make both Navigators work.
I use 2 navigators like this:

<Navigator defaultRoute="/test1"/>
<Navigator id="second" defaultRoute="/test2"/>

But it would only show content from 1 Navigator.

Also, this.$navigator.paths always shows an empty object.