Skip to content

Commit

Permalink
feat(default-theme): Prevent img loading lazy as default
Browse files Browse the repository at this point in the history
  • Loading branch information
quando1910 committed Oct 4, 2022
1 parent ffd9c8e commit c7ee7e7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/default-theme/src/components/atoms/SwImage.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<template>
<SfImage :src="imgUrl" :srcsets="srcsets" v-bind="{ ...$props, ...$attrs }" :placeholder="placeholder" />
<SfImage
:src="imgUrl"
:srcsets="srcsets"
:loading="loading"
:placeholder="placeholder"
v-bind="{ ...$props, ...$attrs }"
/>
</template>

<script>
Expand Down Expand Up @@ -39,10 +45,13 @@ export default {
}
});
const loading = computed(() => props.loading || '');
return {
placeholder: getPlaceholderImage(width, height),
srcsets,
imgUrl
imgUrl,
loading
}
},
}
Expand Down

0 comments on commit c7ee7e7

Please sign in to comment.