This.$f7router.navigate in app.vue dosen't work

I use this.$f7router.navigate in app.vue,the error says navigate is not defined .when i see the console.log,i find this.$f7router is undefined why i can’t use this.$f7router.navigate in app.vue .


Documentation is pretty clear about it

This property only available for components loaded with router (e.g. pages, routable modals, routable tabs). If you need to access this property in “deeper” child components, then you need to pass it down using props.

In main app component you should reference router you need using API, like

1 Like

thank you very very very much~~~

1 Like