Video 6 - Modal

This commit is contained in:
Jeffrey Biles
2020-06-18 12:36:07 -07:00
parent 128c2a2335
commit cab244c0b0
2 changed files with 28 additions and 2 deletions

View File

@@ -17,13 +17,16 @@
</tr>
</tbody>
</table>
<MailView v-if="openedEmail" :email="openedEmail" />
<ModalView v-if="openedEmail" @closeModal="openedEmail = null">
<MailView :email="openedEmail" />
</ModalView>
</template>
<script>
import { format } from 'date-fns';
import axios from 'axios';
import MailView from '@/components/MailView.vue';
import ModalView from '@/components/ModalView.vue';
export default {
async setup(){
@@ -35,7 +38,8 @@
}
},
components: {
MailView
MailView,
ModalView
},
computed: {
sortedEmails() {

View File

@@ -0,0 +1,22 @@
<template>
<div class="modal">
<div class="overlay" @click="emit('closeModal')"></div>
<div class="modal-card">
<slot />
</div>
</div>
</template>
<script>
export default {
setup(props, {emit}) {
return {
emit
}
}
}
</script>
<style scoped>
</style>