mirror of
https://github.com/kevin-DL/build-gmail-clone-with-vue-3.git
synced 2026-01-19 22:05:23 +00:00
async and Suspense
This commit is contained in:
10
src/App.vue
10
src/App.vue
@@ -1,9 +1,15 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
|
||||
<h1>VMail Inbox</h1>
|
||||
|
||||
<MailTable />
|
||||
<Suspense>
|
||||
<template #default>
|
||||
<MailTable />
|
||||
</template>
|
||||
<template #fallback>
|
||||
Loading...
|
||||
</template>
|
||||
</Suspense>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -21,10 +21,9 @@
|
||||
|
||||
<script>
|
||||
import { format } from 'date-fns';
|
||||
import axios from 'axios';
|
||||
|
||||
export default {
|
||||
setup(){
|
||||
async setup(){
|
||||
let emails = [
|
||||
{
|
||||
"id": 1,
|
||||
@@ -63,6 +62,8 @@
|
||||
"read": false
|
||||
}
|
||||
]
|
||||
await new Promise(resolve => setTimeout(resolve, 3000));
|
||||
|
||||
return {
|
||||
format,
|
||||
emails
|
||||
|
||||
Reference in New Issue
Block a user