ditch useState and composables in favour of pinia store - add server rendered note detail page

This commit is contained in:
Michael Dausmann
2023-02-19 01:22:55 +11:00
parent bb9f4dfd1d
commit b3ee03b5c3
10 changed files with 325 additions and 539 deletions

13
pages/notes/[note_id].vue Normal file
View File

@@ -0,0 +1,13 @@
<script setup lang="ts">
const route = useRoute();
const { $client } = useNuxtApp();
const { data: note } = await $client.notes.getById.useQuery({note_id: +route.params.note_id});
</script>
<template>
<div>
<h3>Note Detail {{ route.params.note_id }}</h3>
<pre>{{ note?.note.note_text }}</pre>
<NuxtLink to="/notes/1">Back to Note 1 via an internal link (should not reload page)</NuxtLink>
</div>
</template>