I am trying to change the value by clicking on the button, but Vue does not update this value, although it is updated in the console:
<script setup>
import { ref } from 'vue'
let value = ref(false);
function update() {
value =! value
console.log(value); // changed
}
</script>
<template>
<button @click="update">UPDATE</button>
<p>
{{ value }} - not changed
</p>
</template>
I created an example in Vue SFC Playground: https://sfc.vuejs.org/example_not_change_value
Where do I make a mistake and how to fix it?
consttoletwhere applicable to avoid accidental reassignments