@getlupa/vue 0.6.1 → 0.6.2
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.
- package/dist/lupaSearch.js +11 -5
- package/dist/lupaSearch.mjs +11 -5
- package/dist/src/types/DocumentElement.d.ts +1 -0
- package/package.json +1 -1
package/dist/lupaSearch.js
CHANGED
|
@@ -3624,16 +3624,22 @@ const _sfc_main$1c = /* @__PURE__ */ vue.defineComponent({
|
|
|
3624
3624
|
targetImage.src = placeholder.value;
|
|
3625
3625
|
}
|
|
3626
3626
|
};
|
|
3627
|
+
const imageAlt = vue.computed(() => {
|
|
3628
|
+
const alt = props.options.alt;
|
|
3629
|
+
if (alt) {
|
|
3630
|
+
return alt(props.item);
|
|
3631
|
+
}
|
|
3632
|
+
return "";
|
|
3633
|
+
});
|
|
3627
3634
|
return (_ctx, _cache) => {
|
|
3628
3635
|
var _a, _b;
|
|
3629
3636
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
3630
3637
|
class: vue.normalizeClass((_a = _ctx.wrapperClass) != null ? _a : "")
|
|
3631
3638
|
}, [
|
|
3632
|
-
vue.createElementVNode("img", {
|
|
3633
|
-
class:
|
|
3634
|
-
src: finalUrl.value
|
|
3635
|
-
|
|
3636
|
-
}, null, 42, _hoisted_1$16)
|
|
3639
|
+
vue.createElementVNode("img", vue.mergeProps({
|
|
3640
|
+
class: (_b = _ctx.imageClass) != null ? _b : "",
|
|
3641
|
+
src: finalUrl.value
|
|
3642
|
+
}, { alt: imageAlt.value ? imageAlt.value : void 0 }, { onError: replaceWithPlaceholder }), null, 16, _hoisted_1$16)
|
|
3637
3643
|
], 2);
|
|
3638
3644
|
};
|
|
3639
3645
|
}
|
package/dist/lupaSearch.mjs
CHANGED
|
@@ -3622,16 +3622,22 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
|
3622
3622
|
targetImage.src = placeholder.value;
|
|
3623
3623
|
}
|
|
3624
3624
|
};
|
|
3625
|
+
const imageAlt = computed(() => {
|
|
3626
|
+
const alt = props.options.alt;
|
|
3627
|
+
if (alt) {
|
|
3628
|
+
return alt(props.item);
|
|
3629
|
+
}
|
|
3630
|
+
return "";
|
|
3631
|
+
});
|
|
3625
3632
|
return (_ctx, _cache) => {
|
|
3626
3633
|
var _a, _b;
|
|
3627
3634
|
return openBlock(), createElementBlock("div", {
|
|
3628
3635
|
class: normalizeClass((_a = _ctx.wrapperClass) != null ? _a : "")
|
|
3629
3636
|
}, [
|
|
3630
|
-
createElementVNode("img", {
|
|
3631
|
-
class:
|
|
3632
|
-
src: finalUrl.value
|
|
3633
|
-
|
|
3634
|
-
}, null, 42, _hoisted_1$16)
|
|
3637
|
+
createElementVNode("img", mergeProps({
|
|
3638
|
+
class: (_b = _ctx.imageClass) != null ? _b : "",
|
|
3639
|
+
src: finalUrl.value
|
|
3640
|
+
}, { alt: imageAlt.value ? imageAlt.value : void 0 }, { onError: replaceWithPlaceholder }), null, 16, _hoisted_1$16)
|
|
3635
3641
|
], 2);
|
|
3636
3642
|
};
|
|
3637
3643
|
}
|
|
@@ -24,6 +24,7 @@ export type ImageDocumentElement<T = any> = DocumentElementBase<T> & {
|
|
|
24
24
|
baseUrl?: string;
|
|
25
25
|
key: string;
|
|
26
26
|
customUrl?: (document: T) => string;
|
|
27
|
+
alt?: (document: T) => string;
|
|
27
28
|
};
|
|
28
29
|
export type TitleDocumentElement<T = any> = DocumentElementBase<T> & {
|
|
29
30
|
type: DocumentElementType.TITLE;
|