itube-specs 0.0.722 → 0.0.724

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,9 +6,9 @@
6
6
  :loading="loading"
7
7
  :width="width"
8
8
  :height="height"
9
- :sizes="sizes"
9
+ :sizes="computedSizes"
10
10
  :alt="alt"
11
- decoding="async"
11
+ :decoding="priority ? 'sync' : 'async'"
12
12
  :fetchpriority="priority ? 'high' : 'auto'"
13
13
  @error="emit('error', $event)"
14
14
  >
@@ -22,7 +22,7 @@ const props = withDefaults(defineProps<{
22
22
  src?: string,
23
23
  width: string | number,
24
24
  height: string | number,
25
- sizes: string,
25
+ sizes?: string,
26
26
  urls?: IThumbUrls,
27
27
  alt?: string,
28
28
  loading?: 'lazy' | 'eager',
@@ -33,6 +33,11 @@ const props = withDefaults(defineProps<{
33
33
  fit: 'cover',
34
34
  })
35
35
 
36
+ const computedSizes = computed(() => {
37
+ if (props.loading === 'lazy') return 'auto';
38
+ return props.sizes;
39
+ });
40
+
36
41
  const imgSrc = computed(() => {
37
42
  if (props.src) return props.src
38
43
  if (props.urls) return props.urls.webp[ThumbSize.Medium]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "itube-specs",
3
3
  "type": "module",
4
- "version": "0.0.722",
4
+ "version": "0.0.724",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "./types/index.d.ts",
7
7
  "scripts": {