mirror of
https://github.com/kevin-DL/build-gmail-clone-with-vue-3.git
synced 2026-01-17 05:04:51 +00:00
MIrage + async fetch + suspense
This commit is contained in:
@@ -6,28 +6,11 @@
|
||||
|
||||
<script>
|
||||
import MailTable from '@/components/MailTable.vue';
|
||||
import { ref } from 'vue';
|
||||
export default {
|
||||
setup(props, {attrs, slots}){
|
||||
|
||||
let emails = [{
|
||||
id: 1,
|
||||
subject: 'First Steps',
|
||||
body: 'Learning Vue with Vue 3, cool!',
|
||||
read: false,
|
||||
archived: false,
|
||||
}, {
|
||||
id: 2,
|
||||
subject: 'Vue 3 - pretty cool',
|
||||
body: 'Lots of really good features happening here',
|
||||
read: false,
|
||||
archived: false
|
||||
}, {
|
||||
id: 3,
|
||||
subject: 'Do we have a released date?',
|
||||
body: "I hear Q2 2020.",
|
||||
read: true,
|
||||
archived: false
|
||||
}]
|
||||
async setup(props, {attrs, slots}){
|
||||
let response = await fetch('/api/emails');
|
||||
let emails = await response.json();
|
||||
|
||||
return {emails}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user