UNPKG

l-element-components

Version:

63 lines (62 loc) 1.5 kB
import { defineComponent as i, resolveComponent as o, createElementBlock as m, openBlock as n, createVNode as l, withCtx as t, createBlock as s, resolveDynamicComponent as u, unref as d, renderSlot as p } from "vue"; const f = (e) => e.replace(/(A-Z)g/, "-$1").toLocaleLowerCase(), v = /* @__PURE__ */ i({ __name: "index", props: { icon: { type: String, default: "Bell" }, //通知数量 value: { type: [String, Number], default: "" }, max: { type: Number }, isDot: { type: Boolean, default: !1 } }, setup(e) { return (a, x) => { const c = o("el-badge"), r = o("el-popover"); return n(), m("div", null, [ l(r, { placement: "bottom", width: 350, trigger: "click" }, { default: t(() => [ p(a.$slots, "default") ]), reference: t(() => [ l(c, { style: { cursor: "pointer" }, max: e.max, "is-dot": e.isDot, value: e.value, class: "item" }, { default: t(() => [ (n(), s(u(`el-icon-${d(f)(e.icon)}`))) ]), _: 1 /* STABLE */ }, 8, ["max", "is-dot", "value"]) ]), _: 3 /* FORWARDED */ }) ]); }; } }), _ = { install(e) { e.component("l-notification", v); } }; export { _ as default };