Updated
This commit is contained in:
@@ -38,15 +38,18 @@ const submitComment = async () => {
|
|||||||
|
|
||||||
const limitedComments = computed(() => {
|
const limitedComments = computed(() => {
|
||||||
if (showMoreComments.value) {
|
if (showMoreComments.value) {
|
||||||
return comments.value!.results;
|
return comments.value?.results;
|
||||||
}
|
}
|
||||||
|
|
||||||
return comments.value!.results.slice(0, 3);
|
return comments.value?.results.slice(0, 3);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<section class="bg-slate-50">
|
<section
|
||||||
|
v-if="!!comments"
|
||||||
|
class="bg-slate-50"
|
||||||
|
>
|
||||||
<div class="flex relative gap-8 my-42 container max-lg:flex-col">
|
<div class="flex relative gap-8 my-42 container max-lg:flex-col">
|
||||||
<div
|
<div
|
||||||
class="sticky top-0 flex flex-col gap-6 lg:min-w-[400px] h-fit bg-white p-8 rounded-xl border-[0.5px] border-slate-200"
|
class="sticky top-0 flex flex-col gap-6 lg:min-w-[400px] h-fit bg-white p-8 rounded-xl border-[0.5px] border-slate-200"
|
||||||
@@ -99,13 +102,13 @@ const limitedComments = computed(() => {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-if="comments!.count > 0"
|
v-if="comments.count > 0"
|
||||||
class="flex items-center justify-center w-full"
|
class="flex items-center justify-center w-full"
|
||||||
>
|
>
|
||||||
<Pagination
|
<Pagination
|
||||||
v-if="showMoreComments"
|
v-if="showMoreComments"
|
||||||
:total="comments!.count"
|
:total="comments.count"
|
||||||
:items="comments!.results.map((item, i) => ({ type: 'page', value: i }))"
|
:items="comments.results.map((item, i) => ({ type: 'page', value: i }))"
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
v-else
|
v-else
|
||||||
|
|||||||
Reference in New Issue
Block a user