birdpaper-ui
Version:
一个通用的 vue3 UI组件库。A common vue3 UI component library.
42 lines (41 loc) • 1.78 kB
JavaScript
import _sfc_main from "./image.vue2.js";
import { resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, createVNode, createCommentVNode } from "vue";
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
const _hoisted_1 = ["alt", "title"];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_IconImage2Fill = resolveComponent("IconImage2Fill");
return openBlock(), createElementBlock("div", {
class: normalizeClass(_ctx.clsName),
style: normalizeStyle(_ctx.imgStyle)
}, [
createElementVNode("img", {
ref: "imageRef",
class: normalizeClass(`${_ctx.name}-img`),
alt: _ctx.alt,
title: _ctx.title,
style: normalizeStyle({ ..._ctx.imgStyle, ..._ctx.fitStyle }),
onLoad: _cache[0] || (_cache[0] = (...args) => _ctx.onLoad && _ctx.onLoad(...args)),
onError: _cache[1] || (_cache[1] = (...args) => _ctx.onError && _ctx.onError(...args))
}, null, 46, _hoisted_1),
_ctx.isLoading ? (openBlock(), createElementBlock("div", {
key: 0,
class: normalizeClass(`${_ctx.name}-loading`)
}, [
renderSlot(_ctx.$slots, "loading", {}, () => [
createVNode(_component_IconImage2Fill, { size: "24" })
])
], 2)) : createCommentVNode("", true),
!_ctx.isLoading && _ctx.isError ? (openBlock(), createElementBlock("div", {
key: 1,
class: normalizeClass(`${_ctx.name}-error`)
}, [
renderSlot(_ctx.$slots, "error", {}, () => [
createVNode(_component_IconImage2Fill, { size: "24" })
])
], 2)) : createCommentVNode("", true)
], 6);
}
const _image = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
_image as default
};