Fix: Fix comment area
This commit is contained in:
parent
486db7b781
commit
4825289175
@ -20,7 +20,7 @@ function updateList(comment) {
|
||||
댓글 <span>{{ comments.length }}</span>
|
||||
</h2>
|
||||
<CommentForm @updateList="updateList" :article-id="articleId" v-if="memberStore.isLogin" />
|
||||
<CommentList :comments="comments" />
|
||||
<CommentList :comments="comments" :userId="memberStore.userId" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -1,9 +1,7 @@
|
||||
<script setup>
|
||||
import { useMemberStore } from '@/stores/memberStore';
|
||||
import CommentItem from './CommentItem.vue';
|
||||
|
||||
const { comments } = defineProps({ comments: Array });
|
||||
const { userId } = useMemberStore();
|
||||
const { comments, userId } = defineProps({ comments: Array, userId: String });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -9,6 +9,7 @@ export const useMemberStore = defineStore('memberStore', () => {
|
||||
const accessToken = ref(localStorage.getItem('accessToken'));
|
||||
const isLogin = computed(() => accessToken.value !== null);
|
||||
const userId = computed(() => {
|
||||
if (!isLogin.value) return null;
|
||||
return jwtDecode(accessToken.value).userId;
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user