Skip to content

Commit

Permalink
feat: add ClientOnly
Browse files Browse the repository at this point in the history
  • Loading branch information
ChuChencheng committed Jul 3, 2024
1 parent 9336e99 commit 7a2c528
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
34 changes: 17 additions & 17 deletions site/.vitepress/components/code-demo.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<div
:style="{
width: '100%',
borderRadius: '8px',
padding: '20px',
backgroundColor: '#FFF',
border: '1px solid lightgray',
}"
>
<ClientOnly>
<ClientOnly>
<div
:style="{
width: '100%',
borderRadius: '8px',
padding: '20px',
backgroundColor: '#FFF',
border: '1px solid lightgray',
}"
>
<component :is="component" />
</ClientOnly>
</div>
</div>
</ClientOnly>
<div :style="{ margin: '16px 0' }">
<ClientOnly>
<PlaygroundLink :component="component" />
</ClientOnly>
</div>
<ClientOnly>
<div :style="{ margin: '16px 0' }">
<PlaygroundLink :component="component" />
</div>
</ClientOnly>

::: details {{i18n.showCode}}
<div v-html="sourceCode.markdown"></div>
Expand Down
4 changes: 3 additions & 1 deletion site/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

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

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

## 安装 {#install}

Expand Down
4 changes: 3 additions & 1 deletion site/playground.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ navbar: false
sidebar: false
---

<Playground/>
<ClientOnly>
<Playground/>
</ClientOnly>

<script setup lang="ts">
import { defineClientComponent } from 'vitepress'
Expand Down

0 comments on commit 7a2c528

Please sign in to comment.