In one of my child components, I have a component named Navbar
that includes an option for logging out.
<a @click="(event) => {event.preventDefault();}">
Logout
</a>
This Navbar
component has been imported into my parent component called Home
. Within the Home
component, there is a div serving as a modal:
<div class="modal" v-if="modal">
The modal will only display when the modal reference is set to true
.
<script setup>
import Navbar from './components/Navbar.vue';
import {ref} from 'vue';
const modal = ref(false);
</scipt>
I am curious about how to change the value of the modal reference to true
when the user clicks the logout option in the Navbar
child component.