From 6b7744a16c7bf321fb2874b54d49e3b954f618fa Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Tue, 21 Apr 2020 21:04:33 -0400 Subject: init --- iridescence/src/router/index.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 iridescence/src/router/index.ts (limited to 'iridescence/src/router') diff --git a/iridescence/src/router/index.ts b/iridescence/src/router/index.ts new file mode 100644 index 0000000..8716a04 --- /dev/null +++ b/iridescence/src/router/index.ts @@ -0,0 +1,30 @@ +import Vue from "vue"; +import VueRouter, { RouteConfig } from "vue-router"; +import Home from "../views/Home.vue"; + +Vue.use(VueRouter); + +const routes: Array = [ + { + path: "/", + name: "Home", + component: Home + }, + { + path: "/about", + name: "About", + // 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/About.vue") + } +]; + +const router = new VueRouter({ + mode: "history", + base: process.env.BASE_URL, + routes +}); + +export default router; -- cgit v1.2.3