UNPKG

vue-ele-plus

Version:

62 lines (61 loc) 1.7 kB
import { defineComponent, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createBlock, resolveDynamicComponent, unref } from "vue"; const toLine = (value) => { return value.replace(/(A-Z)g/, "-$1").toLocaleLowerCase(); }; var index_vue_vue_type_style_index_0_scoped_true_lang = ""; var _export_sfc = (sfc, props) => { const target = sfc.__vccOpts || sfc; for (const [key, val] of props) { target[key] = val; } return target; }; const _hoisted_1 = { class: "badge" }; const _sfc_main = /* @__PURE__ */ defineComponent({ props: { icon: { type: String, default: "Bell" }, value: { type: [String, Number], default: "0", required: true, validator: (value) => { return value ? true : false; } }, max: { type: Number, default: 9999 }, isDot: { type: Boolean, default: false } }, setup(__props) { return (_ctx, _cache) => { const _component_el_badge = resolveComponent("el-badge"); return openBlock(), createElementBlock("div", _hoisted_1, [ createVNode(_component_el_badge, { value: __props.value, max: __props.max, "is-dot": __props.isDot }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(`el-icon-${unref(toLine)(__props.icon)}`))) ]), _: 1 }, 8, ["value", "max", "is-dot"]) ]); }; } }); var notification = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-105472ab"]]); var index = { install(app) { app.component("m-notification", notification); } }; export { index as default };