Updated
This commit is contained in:
@@ -38,15 +38,18 @@ const submitComment = async () => {
|
||||
|
||||
const limitedComments = computed(() => {
|
||||
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>
|
||||
|
||||
<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="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
|
||||
v-if="comments!.count > 0"
|
||||
v-if="comments.count > 0"
|
||||
class="flex items-center justify-center w-full"
|
||||
>
|
||||
<Pagination
|
||||
v-if="showMoreComments"
|
||||
:total="comments!.count"
|
||||
:items="comments!.results.map((item, i) => ({ type: 'page', value: i }))"
|
||||
:total="comments.count"
|
||||
:items="comments.results.map((item, i) => ({ type: 'page', value: i }))"
|
||||
/>
|
||||
<Button
|
||||
v-else
|
||||
|
||||
Reference in New Issue
Block a user