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