mirror of
https://github.com/kevin-DL/build-gmail-clone-with-vue-3.git
synced 2026-01-20 06:15:13 +00:00
ArchivedScreen, ability to switch between
However, there's an issue - changes don't stick between screen switches
This commit is contained in:
36
src/components/ArchivedScreen.vue
Normal file
36
src/components/ArchivedScreen.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<h1>VMail Archives</h1>
|
||||
|
||||
<BulkActionBar :emails="archivedEmails" />
|
||||
|
||||
<MailTable :emails="archivedEmails" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MailTable from '@/components/MailTable.vue';
|
||||
import BulkActionBar from '@/components/BulkActionBar.vue';
|
||||
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
export default {
|
||||
async setup(){
|
||||
let response = await fetch('/api/emails');
|
||||
let {emails} = await response.json();
|
||||
|
||||
emails = ref(emails);
|
||||
let archivedEmails = computed(() => {
|
||||
return emails.value.filter(e => e.archived)
|
||||
})
|
||||
|
||||
return {archivedEmails}
|
||||
},
|
||||
components: {
|
||||
MailTable,
|
||||
BulkActionBar
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -13,7 +13,7 @@
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
export default {
|
||||
async setup(props, {attrs, slots}){
|
||||
async setup(){
|
||||
let response = await fetch('/api/emails');
|
||||
let {emails} = await response.json();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user