The watch function for the Set would not work. It would work normally with int.
If I change it from ref() to reactive() it would work.
Is this an expected behavior?
<script setup>
import { ref,watch,reactive } from 'vue'
const msg = ref('Hello World!')
const testSet = ref(new Set());
const testInt = ref(5)
watch([testSet],()=>{
console.log(testSet.value);
})
watch([testInt],()=>{
console.log(testInt.value);
})
const updateTestSet = ()=>{
testSet.value.add(Math.random());
}
const updateTestInt = ()=>{
testInt.value = Math.random();
}
</script>
<template>
<h1>{{ msg }}</h1>
<input v-model="msg" />
<button @click="updateTestSet">TEST SET</button>
<button @click="updateTestInt">TEST INT</button>
</template>