Skip to content

Commit

Permalink
chore: pending state
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Apr 18, 2024
1 parent a1bf537 commit 18a82b3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions examples/vue-ssr-extra/src/root.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ onMounted(() => {
onUpdated(() => {
updated.value++;
});
const suspended = ref(false);
</script>

<template>
Expand All @@ -21,6 +23,7 @@ onUpdated(() => {
>
GitHub
</a>
<span v-if="suspended">...</span>
</div>
<div style="display: flex; align-items: center; gap: 0.5rem">
mounted: {{ mounted }}, updated: {{ mounted }}
Expand All @@ -34,15 +37,17 @@ onUpdated(() => {
<li>
<RouterLink to="/client">Counter (client)</RouterLink>
</li>
<li style="display: flex; gap: 0.5rem">
<RouterLink to="/server">Counter (server)</RouterLink>
<a href="/server?__nojs">(disable js)</a>
<li>
<span style="display: flex; gap: 0.5rem">
<RouterLink to="/server">Counter (server)</RouterLink>
<a href="/server?__nojs">(disable js)</a>
</span>
</li>
</ul>
</nav>
<main>
<RouterView v-slot="{ Component }">
<Suspense>
<Suspense @pending="suspended = true" @resolve="suspended = false">
<component :is="Component"></component>
</Suspense>
</RouterView>
Expand Down

0 comments on commit 18a82b3

Please sign in to comment.