This repository has been archived by the owner on Oct 5, 2019. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 154
How to trigger route change with javascript code #13
Comments
leapon
changed the title
How to trigger route code with javascript code
How to trigger route change with javascript code
Dec 8, 2016
Closed
Each F7View component has a router under f7View.router property. You can access it from your main component with $children[0].$children[0].f7View.router and then save it somewhere with friendlier name. |
@damir Thanks! that works!
|
That does indeed seem to work, but can someone explain the logic behind the long string of children? What exactly are those pointing to? I would expect root > app(child) > views(child) > f7view, but that'd be two children, which is incorrect. |
Yeah, that certainly is not the most intuitive way to access views / the router. As of this PR, it is now possible to do something like this instead: this.$f7['mainView'].loadPage('/page2/') |
Ah, thanks. That's much better! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In the kitchensink example, route changes are achived with link attribute or "back" class name.
For example:
How can I force a route change using javascript code?
I searched source code and saw this.$emit to trigger event. However I can't find where these events are received and route gets changed in Framework7-Vue code base.
The text was updated successfully, but these errors were encountered: