Can switch between inbox and archived mail screens and keep changes in archived videos

This commit is contained in:
Jeffrey Biles
2020-03-18 01:58:05 -07:00
parent 505842df54
commit 279e72dbbf
4 changed files with 51 additions and 25 deletions

View File

@@ -0,0 +1,36 @@
<template>
<div>
<component :is="screenName" :emails="emails" />
</div>
</template>
<script>
import MailScreenArchived from '@/components/MailScreenArchived.vue';
import MailScreenInbox from '@/components/MailScreenInbox.vue';
import { ref } from 'vue';
export default {
async setup(){
let response = await fetch('/api/emails');
let {emails} = await response.json();
emails = ref(emails);
return {emails};
},
components: {
MailScreenArchived,
MailScreenInbox
},
props: {
screenName: {
type: String,
required: true
}
}
}
</script>
<style scoped>
</style>

View File

@@ -10,16 +10,12 @@
import MailTable from '@/components/MailTable.vue';
import BulkActionBar from '@/components/BulkActionBar.vue';
import { computed, ref } from 'vue';
import { computed } from 'vue';
export default {
async setup(){
let response = await fetch('/api/emails');
let {emails} = await response.json();
emails = ref(emails);
async setup({emails}){
let archivedEmails = computed(() => {
return emails.value.filter(e => e.archived)
return emails.filter(e => e.archived)
})
return {archivedEmails}

View File

@@ -10,16 +10,12 @@
import MailTable from '@/components/MailTable.vue';
import BulkActionBar from '@/components/BulkActionBar.vue';
import { computed, ref } from 'vue';
import { computed } from 'vue';
export default {
async setup(){
let response = await fetch('/api/emails');
let {emails} = await response.json();
emails = ref(emails);
async setup({emails}){
let inboxEmails = computed(() => {
return emails.value.filter(e => !e.archived)
return emails.filter(e => !e.archived)
})
return {inboxEmails}