좋아요 싫어요 watch 함수 추가

This commit is contained in:
nevermoregb 2025-04-08 11:28:07 +09:00
parent cf88671869
commit cc01b95350

View File

@ -16,7 +16,7 @@
</template>
<script setup>
import { ref, computed } from 'vue';
import { ref, computed, watch } from 'vue';
const props = defineProps({
comment: {
@ -64,6 +64,11 @@
const likeCount = computed(() => props.comment?.likeCount ?? props.likeCount);
const dislikeCount = computed(() => props.comment?.dislikeCount ?? props.dislikeCount);
watch([() => props.likeClicked, () => props.dislikeClicked], ([likeNewval, dislikeNewval]) => {
likeClicked.value = likeNewval;
dislikeClicked.value = dislikeNewval;
});
const handleLike = () => {
const isLike = !likeClicked.value;
const isDislike = false;