<template>
<EditStudentModal v-if="showModal==='show'"/>
<div v-for="student in prop.students" :key="student.id">
<StudentItem
:student="student"
@editStudent="openEditModal"
/>
</div>
</template>
part of my
let showModal = ref('');
const openEditModal = (data) => {
showModal = 'show';
}
the value of showModal variable changes after triggering the @editStudent event, but v-if does not see it
CodePudding user response:
change showModal = 'show' to showModal.value = 'show'