merge
This commit is contained in:
parent
0667120de5
commit
1089938956
10 changed files with 122 additions and 77 deletions
27
src/App.vue
27
src/App.vue
|
|
@ -1,28 +1,21 @@
|
|||
<template>
|
||||
<component :is="components[data.template]" v-if="data" :data="data" />
|
||||
<h1 v-if="page" class="sr-only">{{ page.content.title }}</h1>
|
||||
<div class="with-sidebar">
|
||||
<Menu />
|
||||
<main>
|
||||
<RouterView />
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useApiStore } from "./stores/api";
|
||||
import { useUserStore } from "./stores/user";
|
||||
import { ref } from "vue";
|
||||
import home from "./views/Home.vue";
|
||||
import notifications from "./views/Notifications.vue";
|
||||
import reunions from "./views/Reunions.vue";
|
||||
import inspirations from "./views/Inspirations.vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
import Menu from "./components/Menu.vue";
|
||||
import { usePageStore } from "./stores/page";
|
||||
|
||||
const components = {
|
||||
home,
|
||||
notifications,
|
||||
reunions,
|
||||
inspirations
|
||||
};
|
||||
const { page } = storeToRefs(usePageStore());
|
||||
|
||||
const { user } = storeToRefs(useUserStore());
|
||||
user.value = kirbyData.user;
|
||||
|
||||
const data = ref(null);
|
||||
const api = useApiStore();
|
||||
api.fetchPageData().then((res) => (data.value = res));
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue