From af1b09f55c27a465fff662f4fc240868f473447a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Thu, 4 Jan 2024 20:46:12 -0500 Subject: [PATCH] fix(components): pagination works now (for realsies) --- components/listings/singleStory.vue | 9 ++-- components/listings/stories.vue | 65 ++++++++++++----------------- 2 files changed, 32 insertions(+), 42 deletions(-) diff --git a/components/listings/singleStory.vue b/components/listings/singleStory.vue index 9e91c7a..a002d2b 100644 --- a/components/listings/singleStory.vue +++ b/components/listings/singleStory.vue @@ -10,12 +10,13 @@ const { token } = useToken(); const dark = inject>("dark"); const { data } = useAuth(); - let prop = defineProps<{ story: IStory; last?: boolean; showActions?: boolean }>(); - const idxo = (prop.last || false ? prop.story.chapters.length : 1) - 1; + const story = defineModel("story", { required: true }); + let prop = defineProps<{ last?: boolean; showActions?: boolean }>(); + const idxo = computed(() => (prop.last || false ? story.value.chapters.length : 1) - 1); // console.log("idx0->", idxo) // log.debug("posti->", prop.story.chapters[ prop.story.chapters.length - 1 ]); - const shortDate = format(Date.parse(prop.story.chapters[prop.story.chapters.length - 1]?.posted!.toString()), "yyyy/MM/dd"); - const longDate = format(Date.parse(prop.story.chapters[prop.story.chapters.length - 1]?.posted!.toString()), "iiii',' yyyy-MM-dd"); + const shortDate = format(Date.parse(story.value.chapters[story.value.chapters.length - 1]?.posted!.toString()), "yyyy/MM/dd"); + const longDate = format(Date.parse(story.value.chapters[story.value.chapters.length - 1]?.posted!.toString()), "iiii',' yyyy-MM-dd");