Navigation
Let's create a simple navigation view so that we can navigate between the two pages we just created.
Creating the Navigation View
Create a new directory named "layout" and add a new template view file inside that directory: src/templates/views/Navigation.js
. You can name the directory whatever you like or add the navigation view inside the "views" directory—it's entirely up to you.
I have also added some styles and a logotype to make it look good.
Showing the Navigation
We want to show the navigation on all the pages, but it is not very efficient to manually add the navigation to every page. Instead, we want to add it to the main global view.
Let's proceed by opening the main JavaScript file: src/main.js
.
Start by importing the navigation at the top:
Edit the mount code by adding the navigation. You can extend Stratox views with
this.block
. Block view is a self-contained dynamic view.
Visit your browser to see the results.
Last updated