Hi Guys. I have a weird case here. My app use tabbar and the logout button is in settings tab. so if I click logout button. The logout function runs successfully, but if I try to login again after that. the tabbar is not set to home tab. it’s still set to settings tab, but the view show the home page.
how to solve this?
Show the home tab and it’s tab-link after logging out
methods: {
logout() {
// After logout success
setTimeout(() => this.$app.tab.show('#view-home', '.home-tab-link', true), 0)
},
}
And make sure you have the right view id / class
<div class="toolbar toolbar-bottom">
<div class="toolbar-inner">
<a href="#view-home" class="tab-link tab-link-active home-tab-link">Home</a>
<a href="#view-settings" class="tab-link settings-tab-link">Settings</a>
</div>
</div>
ok. but where should I put the router navigation code? after set the active tab or before it?
I’ve add this code. but the login page replaced by homepage
setTimeout(() => self.$f7.tab.show('#view-home', '#tab-home', true), 0)
self.goToPage('/login/', {reloadCurrent: true});
After tab show you can navigate:
this.$app.views.main.router.navigate('/login/')
Thank you so much. This is working.