mirror of
https://github.com/kevin-DL/build-gmail-clone-with-vue-3.git
synced 2026-01-18 21:45:09 +00:00
Video 6 - Modal
This commit is contained in:
@@ -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() {
|
||||
|
||||
22
src/components/ModalView.vue
Normal file
22
src/components/ModalView.vue
Normal 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>
|
||||
Reference in New Issue
Block a user