Skip to content

Commit 8da8c77

Browse files
committed
fix: export pages range
1 parent 85214c2 commit 8da8c77

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.vitepress/theme/components/ThemeInfo.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import { defineProps, ref } from 'vue'
3-
import { useIntervalFn } from '@vueuse/core'
3+
import { isClient, useIntervalFn } from '@vueuse/core'
44
import type { ThemeInfo } from '../../themes'
55
66
const props = defineProps<{
@@ -9,10 +9,11 @@ const props = defineProps<{
99
1010
const index = ref(0)
1111
12-
if (props.theme.previews.length > 1) {
12+
if (props.theme.previews.length > 1 && isClient) {
1313
const { resume } = useIntervalFn(() => {
1414
index.value = (index.value + 1) % props.theme.previews.length
1515
}, 3000, false)
16+
// add random defer so they don't starts together
1617
setTimeout(resume, Math.round(1000 * Math.random()))
1718
}
1819
</script>

0 commit comments

Comments
 (0)