Add basic routes, fake components

This commit is contained in:
Christian Cueni 2022-04-13 19:54:06 +02:00
parent 27874adf27
commit 4db21e945a
5 changed files with 47 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import learningPathRoutes from './learningpath.routes'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
@ -16,6 +17,11 @@ const router = createRouter({
// this generates a separate chunk (About.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import('../views/AboutView.vue')
},
{
path: '/learningpath',
component: () => import('../views/LearningPath.vue'),
children: learningPathRoutes
}
]
})

View File

@ -0,0 +1,8 @@
const LearningPathOverview = () => import('../views/LearningPathOverview.vue')
export default [
{
path: ':id',
component: LearningPathOverview,
}
]

View File

@ -0,0 +1,14 @@
<template>
<h1>Lernpfad</h1>
<router-view></router-view>
</template>
<script>
export default {
name: 'LearningPath'
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,13 @@
<template>
<h1>Lernpfad Overview</h1>
</template>
<script>
export default {
name: 'LearningPathOverview'
}
</script>
<style scoped>
</style>

View File

@ -9,6 +9,11 @@ export default defineConfig({
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
},
},
server: {
proxy: {
'/foo': 'http://localhost:4567',
}
}
},
})