In this part, we will create the <template> section of the single file component. Follow these instructions to create the component correctly:
- Create a div HTML element with the id attribute defined as "nav", and inside of it, create three RouterLink components. Those components will point to the Home, About, and Contact routes. In the RouterLink component, we will add a to attribute that will be defined as the route for each component, respectively, and define the text content as the name of the menu:
<div id="nav">
<router-link to="/">
Home
</router-link> |
<router-link to="/about">
About
</router-link> |
<router-link to="/contact">
Contact
</router-link>
</div>