NodeJS + Framework7

At the moment, it is possible to create a new web application based on node js and use Framework 7 in it.

I created such a project and was able to transfer the design from my mobile project to it. However, I am having problems with routing. In the mobile application, I manually recorded routes in the routes.js file, and then in the application itself used them with: onclick="mainView.router.navigate('/page2/');" In a bundle of node js + Framework 7, this approach does not work. How is routing done by means of Framework 7 in the node js application?

I figured out how to configure routing by Fw7 in the nodejs + framework 7 project. I’ll leave a solution here in case someone has the same question.

  1. In the layout code, it is necessary to add classes class="view view-main" to the view container, since Fw7 does not see this container without these classes:
    1

  2. Then in the routes.js file in url, you simply write the name of the route that node js creates for your content pages.:

After that you will be able to use navigation using the internal router Fw7: onclick="mainView.router.navigate('/page2/');"

1 Like