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