henrychavez / nativescript-bottom-navigation

Nativescript plugin for Android & iOS to have the bottom navigation bar of Material Design
Apache License 2.0
58 stars 18 forks source link

[Vue] How to change the stacklayout content when a tab is selected? #47

Closed syahnur197 closed 5 years ago

syahnur197 commented 5 years ago

I would prefer to change the content of the stacklayout instead of using manual routing (this.$navigateTo(page)) way.

I want to achieve similar to when using TabView, however TabView doesn't shrink its TabViewItem when we have more than 3 TabViewItems.

Please help.

henrychavez commented 5 years ago

Hi,

you can try with this plugin https://github.com/lmiller1990/v-switch-case

or search for conditional rendering for Vue. There are a v-if, v-else directives but I don't know if can be applied multiple times if not search for conditional rendering for Vue and you can find a solution

In Angular, we have ngSwitch so it's easier to do what you want to accomplish.

syahnur197 commented 5 years ago

hello sir, i tried v-if after posting this issue. it works!! thank you very much

henrychavez commented 5 years ago

That's great!

Happy coding 😄