Manage a frontend from a module

To make a module using Vuejs frontend structure your module’s template folder should contain this:

vues/data.js
vues/methods.js
vues/computed.js
vues/extra.js
routes.js

Put your different vuejs parts at the appropriate places.

Note: extra.js is just extra global javascript, the rest are Vue parts to be assembled.

Templates

Put a {% block vues %}{% endblock %} in your base template

Settings

Declare your app in settings:

VV_APPS = ["my_app"]

Your frontend parts will be merged into the main app

Client side routing

Optional routing: make a routes.js file into your module template folder and fill it with page.js routes if needed: ex:

page('/someurl/', function(ctx, next) { app.doSomething() } );