Skip to content

Commit 766ec71

Browse files
Attempt to fix LDRS on live
1 parent 4f0d707 commit 766ec71

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

components/LLazyImg.vue

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
<script setup lang="ts">
2-
import 'ldrs/dotStream';
3-
42
const props = defineProps<{
53
src: string | undefined,
64
imgClass?: string
75
}>();
86
97
const source = ref(props.src);
108
const loading = ref(true);
9+
10+
onMounted(async () => {
11+
const { dotStream } = await import('ldrs');
12+
dotStream.register();
13+
});
1114
</script>
1215

1316
<template>
14-
<div class="d-flex justify-content-center align-items-center">
17+
<ClientOnly class="d-flex justify-content-center align-items-center">
1518
<l-dot-stream v-if="loading"
1619
class="w-100 h-100"
1720
size="60"
@@ -23,5 +26,5 @@ const loading = ref(true);
2326
loading="lazy"
2427
v-on:load="loading = false;"
2528
v-on:error="loading = false; source = '/clean-cuts/img/error.png';" />
26-
</div>
29+
</ClientOnly>
2730
</template>

0 commit comments

Comments
 (0)