framework7io / framework7

Full featured HTML framework for building iOS & Android apps
http://framework7.io
MIT License
18.13k stars 3.23k forks source link

Initializing Router with Incorrect Params #3231

Closed akoumjian closed 5 years ago

akoumjian commented 5 years ago

Describe the bug

Setting the pushState params in the f7params on app initialization does not seem to get passed down to the Router instance on initialization. I believe there is a bug on this line where it should just be pointing to app.params instead of app.params.view:

https://github.com/framework7io/framework7/blob/8b8a5bd7702ee9df6f5ac96e744f4ff4e9c491b1/src/core/modules/router/router-class.js#L29

To Reproduce

Steps to reproduce the behavior:

  1. Initialize an app with Framework7-Vue
  2. Pass in f7params to the main app instance such as pushState: true, pushStateSeparator: "",
  3. Observe the browser user not pick up those settings.

Expected behavior

f7params should be used by Router instance at the application level

Actual Behavior

Router is using default view params.

nolimits4web commented 5 years ago

All correct, it must be set as:

f7params = {
  ...
  view: {
    pushState: true,
    ...
  }
}

But the very correct place is to set in on required view explicitly