I tried to use
this.f7router.navigate(’/signup/’)
in App.vue but it did not work so i’ve looked up and found out i shoud do
this.$f7.views.main.router.navigate('/')
istead.
but it still does not work with error in console
Error in mounted hook: “TypeError: Cannot read property ‘router’ of undefined”
my code is below
methods: {
checkLogin(){
if(this.$store.state.isLogin) {
this.$f7.views.main.router.navigate('/')
}else {
this.$f7.views.main.router.navigate('/signup/')
}
}
},
created: function() {
//this.$f7.views.main.router.navigate('/')
},
mounted() {
this.$nextTick(() => {
this.checkLogin()
});
}
any ideas? thanks