Added basic comments.
This commit is contained in:
@@ -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 };
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user