Wow, good work @nolimits4web !!! Please note that with this great type of updates, you are really pushing our expectations for the rest of 2020 sky high
If I understand the new app root component correctly, is this a very nice replacement for manually hiding/showing views for logged in/not logged in?
I usually have two root views, one view for first startup when the user is not logged in yet, and one tabbed view which I manually show when the user is logged in successfully. Although this approach works, it always felt as a dirty way to make things work.
Having a root app element to replace this manual way would be very cool!
Thats awesome! Have been waiting for that, and instantly tryed it out.
on thing i noticed which didnt work well for me is using that in combination of tabs views but maybe i just have to figure out why it doesn’t work, I am using a swipeable tabs view
Beginning of 2019, I began writing a detailed up-to-date F7 tutorial, then I got busy. I came back a couple of weeks later, and you had made some breaking changes, my tutorial was “old”. I managed to catch up and update the tutorial, then again got busy again. Came back 6 weeks later and it was “old” again!
Now I have to catch up with the app component. I haven’t come across such an evolving technology. Keep up the good work!
@nolimits4web Regarding the brand new app root component, what is the best location for storing global app data? I usually have some global (window) vars like login status, which I really would like to add to the correct place. Should I add these to app.data, or put them in app root view component data? Or is it just a developers preference?
If you use app main component, then i will recommend NOT to use app.data and app.methods parameters. Put them to root component instead, and you can reference them from other components via $root, from anywhere else they will be accessible in app.rootComponent. For more global things, like when you need to reference something outside the app or when app is not yet initialized then i would go with global window. vars
@nolimits4web The docs say: “Also note that main app component will be mounted (added to DOM) BEFORE app initialization process finished.”
I currently try to load the main app component from a file using the new app parameter:
var app = new Framework7({
...
componentUrl: './components/app.html',
...
});
While this works in browser environment, when run on iOS the console shows an error, and I think it is because Framework7 tries to fetch the app root component by XHR, before deviceready-event has fired and cordova-plugin-wkwebview-file-xhr is loaded:
I think I can confirm my thoughts, because when I run the var app = new Framework7(...) with the same parameters manually through the console after deviceready, everything works fine. And as expected, I don’t see the XHR request in the network inspector right now, as it is intercepted by the wkwebview XHR plugin.
Currently, I worked around this by wrapping the whole new Framework7(...) in a event handler which fires on deviceready.
Can you please elaborate more on setSwipeSet() or possibly show an example? I am getting the error: TypeError: sheet.setSwipeSet() is not a function. Is it meant to be setSwipeStep? Possibly a typo.