Is there better way to do something before the first page displayed?

Does the first page can be loaded as a router component style or other way?
Or i can just call the instance that was loaded in js and do something through calling Dom7.
At the first time when i load the first page,it won’t run pageInit or pageBeforeIn event .
How to run something in better way?

It calls these events, probably you attach them after page was already loaded. But yes, if it is possible the better way will be to load home page as router component, here is how to do it

Thanks a lot!
I used F7 v2,there is no V3 docment for Chinese.
Hope F7 be better!