File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
packages/vue/src/components Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change 11<script setup lang="ts">
22import { onBeforeUnmount , ref , watchEffect } from ' vue'
3- import { lazyLoad , loadImage , updateSizesAttribute } from ' unlazy'
3+ import { autoSizes as _autoSizes , lazyLoad , loadImage } from ' unlazy'
44import type { ImgHTMLAttributes } from ' vue'
55
66const props = defineProps <{
@@ -38,15 +38,8 @@ watchEffect(() => {
3838 return
3939
4040 if (props .preload ) {
41- updateSizesAttribute (target .value )
42-
43- // Calculate the `sizes` attribute for sources inside a `<picture>` element
44- if (target .value .parentElement ?.tagName .toLowerCase () === ' picture' ) {
45- [... target .value .parentElement .getElementsByTagName (' source' )].forEach (
46- sourceTag => updateSizesAttribute (sourceTag ),
47- )
48- }
49-
41+ if (props .autoSizes )
42+ _autoSizes (target .value )
5043 loadImage (target .value )
5144 return
5245 }
You can’t perform that action at this time.
0 commit comments