mirror of
https://github.com/kevin-DL/build-gmail-clone-with-vue-3.git
synced 2026-01-23 15:41:33 +00:00
Video 6 - Modal
This commit is contained in:
@@ -17,13 +17,16 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<MailView v-if="openedEmail" :email="openedEmail" />
|
<ModalView v-if="openedEmail" @closeModal="openedEmail = null">
|
||||||
|
<MailView :email="openedEmail" />
|
||||||
|
</ModalView>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { format } from 'date-fns';
|
import { format } from 'date-fns';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import MailView from '@/components/MailView.vue';
|
import MailView from '@/components/MailView.vue';
|
||||||
|
import ModalView from '@/components/ModalView.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
async setup(){
|
async setup(){
|
||||||
@@ -35,7 +38,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
MailView
|
MailView,
|
||||||
|
ModalView
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
sortedEmails() {
|
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