Closed cyberbeat closed 5 years ago
On app-load the first page should not be loaded again with ajax, because it is already included in html layout.
sounds like missconfiguration, if it loads page again then it considers it as a different route. Would be good to see full example, better live example.
See here (f7 v.2.3.0), with some console.log output: https://www.wordwar.org/f7bugs/index.php
Two things i see first:
Your pushStateRoot
must be set to jut /f7bugs/
Your initial view url must be set to index.php
Your documentation of pushStateRoot says:
Push state root URL separator, for example "http://my-app.com/". It is useful only in case when you use empty ("") pushStateSeparator
And the documentation for the initial view url (views.create Parameter) says:
Default (initial) View's url. If not specified, then it is equal to document url
I thought that index.php was the document-url
But nontheless your hint seems to fix the issue :-)
Perhaps you could also have a look in the same example for the push-state-append problem?
This is a (multiple allowed):
[x] bug
[ ] enhancement
[ ] feature-discussion (RFC)
Framework7 Version: 2.25
What you did
Expected Behavior
On app-load the first page should not be loaded again with ajax, because it is already included in html layout.
Actual Behavior
I debugged in framework7 code, and found out that in "Router.prototype.init" this line is called
router.history = [documentUrl.split(router.params.pushStateSeparator)[0] || '/', initUrl];
here the history is filled up with '/' and the initUrl (which is not '/', but that is not important) Because of that, a few lines furtherhistoryRestored = true;
is set. This seems to cause the initial page to be loaded twice.