Can I access to previous page's data?

https://framework7.io/docs/router-component.html#virtual-dom

data: function () {
      return {
        // empty initial user data
        user: null,
      }
    },

Look at the above example,
There is data in the component.
And Can I access to the data from other Component(other pages)?

more details)
If we have data at root,
we know that we can access like ‘app.data.variables’

and
what if we have data at different pages(different component) not root,
can we access to the page’s data?

Yes, you can access previous page data.

In the router component, inside pageInit event,

on: {
        pageInit: function(e, page) {
        console.log(page.pageFrom.el.f7Component.data); // Data from previous page
    }
}

Check here for more about page data: https://framework7.io/docs/page.html#page-data

3 Likes

Thank you so much!
You are so amazing!!!

1 Like