import Vue from "vue"; import VueRouter from "vue-router"; import HomeView from "../views/HomeView.vue"; import AboutView from "../views/AboutView.vue"; import stopView from "../views/stopView.vue"; import trafficView from "../views/trafficView.vue"; Vue.use(VueRouter); const routes = [ { path: "/home", name: "home", component: HomeView, }, { path: "/", name: "about", component: AboutView, // route level code-splitting // this generates a separate chunk (about.[hash].js) for this route // which is lazy-loaded when the route is visited. // component: () => import(/* webpackChunkName: "about" */ "../views/AboutView.vue"), }, { path: "/stop", name: "stop", component: stopView, }, { path: "/traffic", name: "traffic", component: trafficView, }, ]; const router = new VueRouter({ mode: "history", base: process.env.BASE_URL, routes, }); export default router;