Remove layouts

This commit is contained in:
Christian Cueni 2022-05-04 13:09:56 +02:00
parent 65313668cc
commit 49c8148fd2
7 changed files with 25 additions and 78 deletions

View File

@ -1,11 +1,8 @@
<template>
<div id="app">
<AppLayout>
<RouterView />
</AppLayout>
<RouterView />
</div>
</template>
<script setup lang="ts">
import AppLayout from "@/layouts/AppLayout.vue";
</script>

View File

@ -1,35 +0,0 @@
<template>
<component :is="layout">
<slot />
</component>
</template>
<script>
import AppLayoutDefault from './AppLayoutDefault.vue'
import { markRaw, watch, shallowRef } from 'vue'
import { useRoute } from 'vue-router'
export default {
name: 'AppLayout',
setup() {
// https://stackoverflow.com/questions/69048657/dynamic-layout-in-vue-3-with-vite
const layout = shallowRef(AppLayoutDefault)
const route = useRoute()
watch(
() => route.meta?.layout,
async metaLayout => {
try {
if (metaLayout === undefined) {
return false
}
const component = await import(/* @vite-ignore */ `./${metaLayout}.vue`)
layout.value = markRaw(component?.default || AppLayoutDefault)
} catch (e) {
layout.value = markRaw(AppLayoutDefault)
}
},
{ immediate: true }
)
return { layout }
}
}
</script>

View File

@ -1,12 +0,0 @@
<template>
<VBVNavigationBar />
<MainNavigationBar />
<div>
<slot />
</div>
</template>
<script setup lang="ts">
import VBVNavigationBar from '@/components/VBVNavigationBar.vue'
import MainNavigationBar from '@/components/MainNavigationBar.vue'
</script>

View File

@ -1,5 +0,0 @@
<template>
<div>
<slot />
</div>
</template>

View File

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

View File

@ -0,0 +1,24 @@
<template>
<VBVNavigationBar />
<MainNavigationBar />
<div>
Sidebar
</div>
<main>
main
</main>
</template>
<script>
import MainNavigationBar from "../components/MainNavigationBar.vue";
import VBVNavigationBar from "../components/VBVNavigationBar.vue";
export default {
name: "CircleView",
components: {MainNavigationBar, VBVNavigationBar}
}
</script>
<style scoped>
</style>

View File

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