좋아요 싫어요 watch 함수 추가
This commit is contained in:
parent
cf88671869
commit
cc01b95350
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user