How can I change the prop value of a component and notify these components about the change?
Parent.vue
<script setup>
import Child from './Child.vue'
const finished = ref(false)
function submit() {
finished.value = true;
}
</script>
<template>
<Child :open="finished">
<button @click="submit">Klick</button>
</template>
Child.vue
<template>
<div v-if="open">Dies ist ein Test.</div>
</template>
<script setup>
import { ref } from 'vue'
const props = defineProps(['open'])
const open = ref(props.open)
</script>
When I click on the button, the value changes, but the child component is not notified about it. console.log(open) is still false.
I am using Vue.js version 3 with the composition API.