Added router

This commit is contained in:
2021-04-07 10:32:27 +02:00
parent e8aa091d71
commit 41ba3104e0
6 changed files with 78 additions and 15 deletions

30
src/router/index.js Normal file
View File

@@ -0,0 +1,30 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import About from '../views/About.vue'
Vue.use(VueRouter)
const routes = [
{
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: About
}
]
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes
})
export default router