2023-12-06 21:44:59 -05:00
|
|
|
<script lang="ts" setup>
|
2023-12-20 17:23:31 -05:00
|
|
|
import { storyMiddleware } from "@client/middleware";
|
|
|
|
import { IStory } from "@models/stories";
|
2023-12-06 21:44:59 -05:00
|
|
|
|
|
|
|
definePageMeta({
|
|
|
|
middleware: [storyMiddleware],
|
|
|
|
});
|
|
|
|
const rtr = useRoute();
|
2023-12-29 20:53:29 -05:00
|
|
|
const { data: story, error } = await useApiFetch<IStory>(`/story/${rtr.params.id}`);
|
2023-12-06 21:44:59 -05:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<a-list :data-source="story.chapters">
|
|
|
|
<template #renderItem="{ item, index }">
|
|
|
|
<a-list-item>
|
|
|
|
<a-list-item-meta>
|
|
|
|
<template #title>
|
|
|
|
<b>
|
|
|
|
<nuxt-link :to="`/story/${story._id}/${index + 1}`">
|
|
|
|
{{ item.title || "Untitled" }}
|
|
|
|
</nuxt-link>
|
|
|
|
</b>
|
|
|
|
</template>
|
|
|
|
</a-list-item-meta>
|
|
|
|
<div v-html="item.summary"></div>
|
|
|
|
</a-list-item>
|
|
|
|
</template>
|
|
|
|
</a-list>
|
|
|
|
</template>
|