mirror of
https://github.com/kevin-DL/build-gmail-clone-with-vue-3.git
synced 2026-01-16 21:04:33 +00:00
31 lines
567 B
Vue
31 lines
567 B
Vue
<template>
|
|
<div class="email-display">
|
|
<h2 class="mb-0">Subject: <strong>{{email.subject}}</strong></h2>
|
|
<div><em>From {{email.from}} on {{format(new Date(email.sentAt), 'MMM do yyyy')}}</em></div>
|
|
<div v-html="marked(email.body)" />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { format } from 'date-fns';
|
|
import marked from 'marked';
|
|
|
|
export default {
|
|
setup(){
|
|
return {
|
|
format,
|
|
marked
|
|
}
|
|
},
|
|
props: {
|
|
email: {
|
|
type: Object,
|
|
required: true
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
|
|
</style> |