Skip to content

Commit c9125d7

Browse files
committed
docs: Try to resolve hydration issue on demo components
1 parent 6f2b19b commit c9125d7

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

docs/.vitepress/theme/components/GlobalDemo.vue

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
<template>
2-
<VueDatePicker
3-
v-model="modelBind"
4-
:dark="isDark"
5-
v-bind="$attrs"
6-
:placeholder="placeholder"
7-
:locale="localized ? zhCN : undefined"
8-
>
9-
<template v-for="(slot, i) in Object.keys(slots)" #[slot]="args" :key="i">
10-
<slot :name="slot" v-bind="args" />
11-
</template>
12-
</VueDatePicker>
2+
<ClientOnly>
3+
<VueDatePicker
4+
v-model="modelBind"
5+
:dark="isDark"
6+
v-bind="$attrs"
7+
:placeholder="placeholder"
8+
:locale="localized ? zhCN : undefined"
9+
>
10+
<template v-for="(slot, i) in Object.keys(slots)" #[slot]="args" :key="i">
11+
<slot :name="slot" v-bind="args" />
12+
</template>
13+
</VueDatePicker>
14+
</ClientOnly>
1315
</template>
1416

1517
<script lang="ts" setup>

docs/.vitepress/theme/components/TimeZoneDemo.vue

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<template>
2-
<div>
3-
<VueDatePicker v-model="modelBind" :dark="isDark" placeholder="Select Date" timezone="utc" />
4-
<div class="flex gapped" style="margin-top: 1rem">
5-
<button class="theme-btn" type="button" @click="getDate">Get date</button>
6-
<button class="theme-btn" type="button" @click="getDateInTimeZone">Get date in the timezone</button>
2+
<ClientOnly>
3+
<div>
4+
<VueDatePicker v-model="modelBind" :dark="isDark" placeholder="Select Date" timezone="utc" />
5+
<div class="flex gapped" style="margin-top: 1rem">
6+
<button class="theme-btn" type="button" @click="getDate">Get date</button>
7+
<button class="theme-btn" type="button" @click="getDateInTimeZone">Get date in the timezone</button>
8+
</div>
79
</div>
8-
</div>
10+
</ClientOnly>
911
</template>
1012

1113
<script lang="ts" setup>

docs/props/modes/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ To deselect the date, click on the selected value
286286
- For additional `multi-dates` configuration properties, please refer to [`multi-dates` configuration section](/props/modes-configuration/#multi-dates-configuration)
287287
:::
288288

289-
<GlobalDemo :multi-dates="true" placeholder="Select Multiple Dates"></GlobalDemo>
289+
<GlobalDemo :multiDates="true" placeholder="Select Multiple Dates"></GlobalDemo>
290290

291291
::: details Code Example
292292
```vue

0 commit comments

Comments
 (0)