With the router working as expected, we can now proceed with adding links into our application, allowing the user to navigate around the website. Links can be achieved in two ways: we can use a conventional <a href="#/about"> tag, or alternatively we can utilize a new HTML element provided with the router of <router-link to="/about">. When using the router-link element, it works the same as an <a> tag, and in fact gets converted to one when running in the browser, but allows a lot more customization and integration with the router.
It is highly advised to use the router-link element wherever possible, as it carries several advantages over the standard link:
- Mode changes: The first advantage is linked to the mode of the router. Using the router link allows you to change the mode of your router, say from hash...