create opened comment structure
This commit is contained in:
parent
fb36329556
commit
173479eaa6
1 changed files with 33 additions and 20 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
<aside id="comments-container" aria-labelledby="comments-label">
|
<aside id="comments-container" aria-labelledby="comments-label">
|
||||||
<h2 id="comments-label" class="sr-only">Commentaires</h2>
|
<h2 id="comments-label" class="sr-only">Commentaires</h2>
|
||||||
<div class="comments | flow">
|
<div class="comments | flow">
|
||||||
|
<template v-if="!openedComment">
|
||||||
<article
|
<article
|
||||||
v-for="(comment, commentIndex) in Object.values(comments).reverse()"
|
v-for="(comment, commentIndex) in Object.values(comments).reverse()"
|
||||||
:key="commentIndex"
|
:key="commentIndex"
|
||||||
|
|
@ -23,6 +24,15 @@
|
||||||
{{ comment.text }}
|
{{ comment.text }}
|
||||||
</p>
|
</p>
|
||||||
</article>
|
</article>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<article>
|
||||||
|
{{ openedComment.title }}
|
||||||
|
</article>
|
||||||
|
<div class="replies">
|
||||||
|
<article v-for="reply in openedComment.replies"></article>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
id="create-comment"
|
id="create-comment"
|
||||||
|
|
@ -74,10 +84,13 @@ const { currentPageIndex, file, comments } = defineProps({
|
||||||
file: Object,
|
file: Object,
|
||||||
comments: Object,
|
comments: Object,
|
||||||
});
|
});
|
||||||
|
|
||||||
const { user } = useUserStore();
|
const { user } = useUserStore();
|
||||||
const { page } = usePageStore();
|
const { page } = usePageStore();
|
||||||
const api = useApiStore();
|
const api = useApiStore();
|
||||||
|
|
||||||
|
const openedComment = ref(null);
|
||||||
|
|
||||||
const newCommentText = ref("");
|
const newCommentText = ref("");
|
||||||
const isAddOpen = ref(false);
|
const isAddOpen = ref(false);
|
||||||
const emits = defineEmits(["update:file"]);
|
const emits = defineEmits(["update:file"]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue