birdpaper-ui
Version:
一个通用的 vue3 UI组件库。A common vue3 UI component library.
41 lines (40 loc) • 1.8 kB
JavaScript
;
const image_vue_vue_type_script_lang = require("./image.vue2.js");
const vue = require("vue");
const _pluginVue_exportHelper = require("../../_virtual/_plugin-vue_export-helper.js");
const _hoisted_1 = ["alt", "title"];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_IconImage2Fill = vue.resolveComponent("IconImage2Fill");
return vue.openBlock(), vue.createElementBlock("div", {
class: vue.normalizeClass(_ctx.clsName),
style: vue.normalizeStyle(_ctx.imgStyle)
}, [
vue.createElementVNode("img", {
ref: "imageRef",
class: vue.normalizeClass(`${_ctx.name}-img`),
alt: _ctx.alt,
title: _ctx.title,
style: vue.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 ? (vue.openBlock(), vue.createElementBlock("div", {
key: 0,
class: vue.normalizeClass(`${_ctx.name}-loading`)
}, [
vue.renderSlot(_ctx.$slots, "loading", {}, () => [
vue.createVNode(_component_IconImage2Fill, { size: "24" })
])
], 2)) : vue.createCommentVNode("", true),
!_ctx.isLoading && _ctx.isError ? (vue.openBlock(), vue.createElementBlock("div", {
key: 1,
class: vue.normalizeClass(`${_ctx.name}-error`)
}, [
vue.renderSlot(_ctx.$slots, "error", {}, () => [
vue.createVNode(_component_IconImage2Fill, { size: "24" })
])
], 2)) : vue.createCommentVNode("", true)
], 6);
}
const _image = /* @__PURE__ */ _pluginVue_exportHelper(image_vue_vue_type_script_lang, [["render", _sfc_render]]);
module.exports = _image;