[Vuejs]-Why is it not possible to achieve reactivity with ref in Vue 3?

1👍

You should use .value in script when using Ref.
This may help.

<script setup>
import { ref } from 'vue'
let value = ref(false);
function update() {
    value.value = !value.value
    console.log(value.value); // changed
}
</script>

<template>
  <button @click="update">UPDATE</button>
  <p>
    {{ value }} - not changed
  </p>

</template>

Leave a comment