yk-element-components
Version:
63 lines (62 loc) • 1.5 kB
JavaScript
import { defineComponent as s, resolveComponent as l, openBlock as r, createBlock as i, withCtx as c, renderSlot as p, createVNode as d, resolveDynamicComponent as u, unref as _ } from "vue";
const m = (e) => e.replace(/(A-Z)g/, "-$1").toLocaleLowerCase(), f = /* @__PURE__ */ s({
__name: "index",
props: {
icon: {
type: String,
default: "Bell"
},
value: {
type: [String, Number],
default: ""
},
max: {
type: Number
},
isDot: {
type: Boolean,
default: !1
}
},
setup(e) {
return (t, o) => {
const n = l("el-badge"), a = l("el-popover");
return r(), i(a, {
"popper-class": "notification-popper-class",
placement: "bottom",
trigger: "click",
width: 300
}, {
default: c(() => [
p(t.$slots, "default", {}, void 0, !0)
]),
reference: c(() => [
d(n, {
value: e.value,
max: e.max,
"is-dot": e.isDot
}, {
default: c(() => [
(r(), i(u(`el-icon-${_(m)(e.icon)}`)))
]),
_: 1
}, 8, ["value", "max", "is-dot"])
]),
_: 3
});
};
}
});
const v = (e, t) => {
const o = e.__vccOpts || e;
for (const [n, a] of t)
o[n] = a;
return o;
}, x = /* @__PURE__ */ v(f, [["__scopeId", "data-v-0e69d0be"]]), y = {
install(e) {
e.component("yk-notification", x);
}
};
export {
y as default
};