mine-h5-ui
Version:
一款轻量级、模块化基于 Vue3.x 的 H5 前端 UI 组件库 👍
39 lines (38 loc) • 1.33 kB
JavaScript
import { defineComponent as s, openBlock as o, createElementBlock as a, normalizeStyle as u, normalizeClass as m, createElementVNode as n, toDisplayString as f, unref as i, createCommentVNode as x } from "vue";
import { useHandler as h } from "./hooks.js";
const y = { class: "txt" }, $ = /* @__PURE__ */ s({
name: "MeTag",
__name: "index",
props: {
type: { default: "primary" },
plain: { type: Boolean, default: !1 },
radius: { default: 4 },
width: {},
height: { default: 24 },
color: { default: "" },
text: { default: "标签" },
textColor: { default: "" },
closeable: { type: Boolean, default: !1 }
},
emits: ["close"],
setup(e, { emit: r }) {
const d = r, { onClose: t } = h(d);
return (g, l) => (o(), a("div", {
class: m(["me-tag", [e.type, e.plain && "plain"]]),
style: u(`width:${e.width}px;height:${e.height}px;border-color:${e.color};border-radius:${e.radius}px;background:${e.color};color:${e.textColor};`)
}, [
n("div", y, [
n("span", null, f(e.text), 1),
e.closeable ? (o(), a("i", {
key: 0,
class: "iconfont icon-baseline-close-px",
onClick: l[0] || (l[0] = //@ts-ignore
(...c) => i(t) && i(t)(...c))
})) : x("", !0)
])
], 6));
}
});
export {
$ as default
};