elk/pages/@[user]/[post].vue

23 lines
791 B
Vue
Raw Normal View History

2022-11-13 19:05:32 +03:00
<script setup lang="ts">
const props = defineProps<{
modelValue?: boolean
}>()
const params = useRoute().params
2022-11-14 17:54:30 +03:00
const id = computed(() => params.post as string)
2022-11-14 06:33:09 +03:00
const masto = await useMasto()
2022-11-14 17:54:30 +03:00
const { data: status } = await useAsyncData(`${id}-status`, () => masto.statuses.fetch(params.post as string))
const { data: context } = await useAsyncData(`${id}-context`, () => masto.statuses.fetchContext(params.post as string))
2022-11-13 19:05:32 +03:00
</script>
<template>
2022-11-18 12:37:22 +03:00
<template v-for="comment of context?.ancestors" :key="comment.id">
<StatusCard :status="comment" border="t border" pt-4 />
</template>
2022-11-21 00:25:26 +03:00
<StatusDetails :status="status" border="t border" pt-4 />
2022-11-14 17:54:30 +03:00
<template v-for="comment of context?.descendants" :key="comment.id">
2022-11-21 00:25:26 +03:00
<StatusCard :status="comment" pt-4 />
2022-11-14 17:54:30 +03:00
</template>
2022-11-13 19:05:32 +03:00
</template>