In my startup routine, once basic data is loaded from the API, I update the store:
store.state.init = true
This works, as the welcome view is displayed, but it is not auto-initialized as I would expect, and the route /welcome is not loaded. (component not loaded by XHR and view stays empty) No errors on the console.
Do I have to manually initialize it? And if yes, what is the right moment. In the past I did this using a callback on the setState method, to be sure that the state changes are processed.
Thanks deejay! I found the problem in my app root component, I was simply missing the outer wrapper: <div id="app"> ... </div>
Btw, I save your example as quick boiler plate template, cool! I had base templates like this for F7 v5, but wanted to use the last F7 version for a new project.
One minor thing, in my setup, the active tab indicator is missing (tab-link-highlight element). If you switch to another tab it appears and works as expected.
Thanks, was just writing the same line In your first sandbox, you don’t have this line and the highlight element is still there. Is that just a coincidence by the way the views are setup? So that the order of rendering is correct so F7 automatically “knows” what the active tab is?
Perfect! Is there some component event which is triggered when store.init is set to false and the page in view-welcome is unloaded? I was checking page:beforeremove, but this doesn’t seem to be triggered.
Maybe I’m thinking the ‘wrong way’? I want to gracefully unload/cleanup custom things in page components when a view is removed from DOM like this.