mine-h5-ui
Version:
一款轻量级、模块化基于 Vue3.x 的 H5 前端 UI 组件库 👍
48 lines (47 loc) • 1.47 kB
JavaScript
import { defineComponent as f, createElementBlock as t, openBlock as l, unref as i, normalizeStyle as a } from "vue";
import { useImgEvent as h } from "./hooks.js";
/*!
* mine-h5-ui v2.15.0
* Copyright (c) 2025 biaov
* @license MIT
*/
const p = ["src", "alt"], w = /* @__PURE__ */ f({
name: "MeImg",
__name: "index",
props: {
src: {},
width: { default: "" },
height: { default: "" },
fill: { default: "" },
radius: { default: "0" },
alt: { default: "" }
},
emits: ["click", "load", "error"],
setup(g, { emit: u }) {
const m = u, { onClick: n, onLoad: d, onError: s } = h(m);
return (e, r) => (l(), t("div", {
class: "me-img",
onClick: r[2] || (r[2] = //@ts-ignore
(...o) => i(n) && i(n)(...o))
}, [
e.fill ? (l(), t("span", {
key: 1,
style: a(`width:${e.width};height:${e.height};border-radius:${e.radius};background:url(${e.src}) no-repeat center;background-size:${e.fill};`)
}, null, 4)) : (l(), t("img", {
key: 0,
src: e.src,
width: "40px",
height: "40px",
alt: e.alt,
style: a(`width:${e.width};height:${e.height};border-radius:${e.radius};`),
onLoad: r[0] || (r[0] = //@ts-ignore
(...o) => i(d) && i(d)(...o)),
onError: r[1] || (r[1] = //@ts-ignore
(...o) => i(s) && i(s)(...o))
}, null, 44, p))
]));
}
});
export {
w as default
};