@aw-studio/vue-lit-image-next
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -6,3 +6,3 @@ import { defineComponent, useAttrs, computed, inject, openBlock, createElementBlock, createElementVNode, mergeProps, unref } from 'vue'; | ||
var _hoisted_2 = ["src", "data-srcset"]; | ||
var script = defineComponent({ | ||
var script = /*#__PURE__*/ defineComponent({ | ||
props: { | ||
@@ -17,2 +17,19 @@ image: { | ||
var attrs = useAttrs(); | ||
var gif = computed(function () { | ||
if (!Array.isArray(props.image)) { | ||
return props.image.original_url; | ||
} | ||
if (Array.isArray(props.image)) { | ||
return props.image[0].original_url; | ||
} | ||
}); | ||
var isGif = computed(function () { | ||
if (!Array.isArray(props.image) && props.image.mime_type == 'image/gif') { | ||
return true; | ||
} | ||
if (Array.isArray(props.image) && props.image[0].mime_type == 'image/gif') { | ||
return true; | ||
} | ||
return false; | ||
}); | ||
var getMediaConversions = function () { | ||
@@ -80,3 +97,3 @@ var imageConversions = []; | ||
if (url[0] == conversion[0]) { | ||
srcset = srcset + (" " + url[1] + " " + conversion[1] + "w,"); | ||
srcset = srcset + " ".concat(url[1], " ").concat(conversion[1], "w,"); | ||
} | ||
@@ -89,6 +106,6 @@ } | ||
createElementVNode("img", mergeProps({ | ||
src: unref(thumbnail), | ||
src: unref(isGif) ? unref(gif) : unref(thumbnail), | ||
class: "lazyload lazyload-animation lit-image" | ||
}, unref(attrs), { | ||
"data-srcset": unref(dataSrcset), | ||
"data-srcset": unref(isGif) ? null : unref(dataSrcset), | ||
"data-sizes": "auto" | ||
@@ -95,0 +112,0 @@ }), null, 16 /* FULL_PROPS */, _hoisted_2) |
{ | ||
"name": "@aw-studio/vue-lit-image-next", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "A vue-lit-image that supports vue 3.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26941
553