Added basic comments.

This commit is contained in:
2023-06-11 05:32:02 +02:00
parent 9a9b92a6b1
commit 0d5744e3ff
26 changed files with 441 additions and 89 deletions

View File

@@ -1,15 +1,11 @@
import { fetchShelves } from '../../src/shelves';
async function onBeforeRender(_pageContext) {
async function getPageData() {
const shelves = await fetchShelves();
return {
pageContext: {
pageData: {
shelves,
},
},
shelves,
};
}
export { onBeforeRender };
export { getPageData };

View File

@@ -1,17 +1,12 @@
<template>
<div class="content">
<ul>
<li><a
href="/shelf/1"
class="link"
>Go to shelf</a></li>
<li><a
href="/shelf/create"
class="link"
>Create new shelf</a></li>
<li><a
<li v-if="!user"><a
href="/account/login"
class="link"
>Log in</a></li>
@@ -37,6 +32,6 @@
<script setup>
import { usePageContext } from '../../renderer/usePageContext';
const { pageData } = usePageContext();
const { user, pageData } = usePageContext();
const { shelves } = pageData;
</script>