We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85214c2 commit 8da8c77Copy full SHA for 8da8c77
.vitepress/theme/components/ThemeInfo.vue
@@ -1,6 +1,6 @@
1
<script setup lang="ts">
2
import { defineProps, ref } from 'vue'
3
-import { useIntervalFn } from '@vueuse/core'
+import { isClient, useIntervalFn } from '@vueuse/core'
4
import type { ThemeInfo } from '../../themes'
5
6
const props = defineProps<{
@@ -9,10 +9,11 @@ const props = defineProps<{
9
10
const index = ref(0)
11
12
-if (props.theme.previews.length > 1) {
+if (props.theme.previews.length > 1 && isClient) {
13
const { resume } = useIntervalFn(() => {
14
index.value = (index.value + 1) % props.theme.previews.length
15
}, 3000, false)
16
+ // add random defer so they don't starts together
17
setTimeout(resume, Math.round(1000 * Math.random()))
18
}
19
</script>
0 commit comments