Full-Stack Web Development with Go by Nanik Tolaram & Nick Glynn
Author:Nanik Tolaram & Nick Glynn
Language: eng
Format: epub
Publisher: Packt
Published: 2023-11-15T00:00:00+00:00
Figure 7.5: Router sample application
The App.vue file contains the Vue Router information, which can be seen as follows:
<template> <div id="routerdiv"> <table> ... <router-link :to="{ name: 'Home'}">Home </router-link> ... <router-link :to="{ name: 'Login'}">Login </router-link> ... </table> <router-view></router-view> </div> </template>
The preceding router-link route is defined inside router/index.js, as shown:
const routes = [ { path: '/', name: 'Home', component: Home }, { path: '/login', name: 'Login', component: Login }, ];
The <router-link/> tag defines the router configuration that the application has, and in our case, this is pointing to the Home and Login components declared inside the index.js file under the router folder, as shown:
import Vue from 'vue'; import { createRouter, createWebHashHistory } from 'vue-router' import Home from '../views/Home.vue'; import Login from "../views/Login.vue"; Vue.use(VueRouter); const routes = [ { path: '/', name: 'Home', component: Home }, { path: '/login', name: 'Login', component: Login }, ]; const router = createRouter({ history: createWebHashHistory(), base: process.env.BASE_URL, routes }) export default router
Each of the defined routes is mapped to its respective components, which are the Home and Login components, which can be found inside the views folder.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
AI & Machine Learning | Bioinformatics |
Computer Simulation | Cybernetics |
Human-Computer Interaction | Information Theory |
Robotics | Systems Analysis & Design |
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8258)
Test-Driven Development with Java by Alan Mellor(6386)
Data Augmentation with Python by Duc Haba(6285)
Principles of Data Fabric by Sonia Mezzetta(6062)
Hadoop in Practice by Alex Holmes(5938)
Learn Blender Simulations the Right Way by Stephen Pearson(5922)
Microservices with Spring Boot 3 and Spring Cloud by Magnus Larsson(5810)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5783)
RPA Solution Architect's Handbook by Sachin Sahgal(5207)
Big Data Analysis with Python by Ivan Marin(5175)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(5102)
The Infinite Retina by Robert Scoble Irena Cronin(4896)
Pretrain Vision and Large Language Models in Python by Emily Webber(4153)
Functional Programming in JavaScript by Mantyla Dan(4018)
The Age of Surveillance Capitalism by Shoshana Zuboff(3914)
Infrastructure as Code for Beginners by Russ McKendrick(3910)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3614)
Embracing Microservices Design by Ovais Mehboob Ahmed Khan Nabil Siddiqui and Timothy Oleson(3425)
Applied Machine Learning for Healthcare and Life Sciences Using AWS by Ujjwal Ratan(3400)
