When passing a prop to a component that declares its state, I am attempting to watch the prop and set the CSS styling accordingly. However, for some reason it is not working as expected. Can anyone help me figure out what might be wrong?
<script setup>
import { onMounted, reactive, ref, watch, watchEffect } from 'vue'
const props = defineProps({
title: String,
date: String,
state: String,
})
let cardStatus = ref('')
watch(props.state, () => {
if (props.state === 'finished'){
cardStatus.value = 'border border-success'
}
})
</script>
<template>
<div :class="'bg-main-light rounded-2xl w-full p-3 lg:px-5 ' + cardStatus"></div>
</template>