Skip to content

Commit

Permalink
feat: add Suspense fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
ChuChencheng committed Jul 4, 2024
1 parent dbff840 commit 02d7b2b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
16 changes: 8 additions & 8 deletions site/.vitepress/components/code-demo.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Suspense>
<DemoRender :component="component" />

<template #fallback>
Loading demo...
</template>
</Suspense>

<ClientOnly>
<div :style="{ margin: '16px 0' }">
<PlaygroundLink :component="component" />
</div>
</ClientOnly>
<div :style="{ margin: '16px 0' }">
<PlaygroundLink :component="component" />
</div>

::: details {{i18n.showCode}}
<ClientOnly>
<div v-html="sourceCode.markdown"></div>
</ClientOnly>
<div v-html="sourceCode.markdown"></div>
:::

<script setup lang="ts">
Expand Down
4 changes: 1 addition & 3 deletions site/en/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

## Try It Online {#try-it-online}

<ClientOnly>
<div>Refer to <PlaygroundLink component="DataDisplay" text="Playground" /> to try it online</div>
</ClientOnly>
<div>Refer to <PlaygroundLink component="DataDisplay" text="Playground" /> to try it online</div>

## Install {#install}

Expand Down
4 changes: 1 addition & 3 deletions site/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

## 在线尝试 {#try-it-online}

<ClientOnly>
<div>前往 <PlaygroundLink component="DataDisplay" text="Playground" /> 在线尝试</div>
</ClientOnly>
<div>前往 <PlaygroundLink component="DataDisplay" text="Playground" /> 在线尝试</div>

## 安装 {#install}

Expand Down

0 comments on commit 02d7b2b

Please sign in to comment.