From fd4206b989ab25f65b97ffed76ca0bb1f2e66184 Mon Sep 17 00:00:00 2001 From: Raymonzut <40148684+Raymonzut@users.noreply.github.com> Date: Fri, 24 Apr 2020 10:58:53 +0200 Subject: [PATCH] Define router with routes for Home and posts --- client/src/router/index.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 client/src/router/index.js diff --git a/client/src/router/index.js b/client/src/router/index.js new file mode 100644 index 0000000..d42ca9b --- /dev/null +++ b/client/src/router/index.js @@ -0,0 +1,27 @@ +import Vue from 'vue' +import VueRouter from 'vue-router' +import Home from '../views/Home.vue' +import posts from '../views/posts.vue' + +Vue.use(VueRouter) + +const routes = [ + { + path: "/", + name: "Home", + component: Home, + }, + { + path: "/posts", + name: "Posts", + component: posts, + }, +] + +const router = new VueRouter({ + mode: "history", + base: process.env.BASE_URL, + routes, +}) + +export default router