UNPKG

cc-element-components

Version:

该项目是基于`element-plus`二次封装组件,使用的技术栈为`vue3` + `typescript` + `element-plus`。在此项目当中,我们会基于`element-plus`的组件库已有组件封装如下组件: - 图标选择器 - 时间选择器 - 城市选择器 - 省市区选择器 - 通知菜单 - 趋势标记 - 评论 - 数据列表 - 数值统计 - 倒计时 - 分割面板 - 时间轴 - 弹框拓展 - 进度条拓展 - 导航菜单拓展 - 可配置项表格 - 可配置项表单 - 日历

68 lines (67 loc) 1.92 kB
import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, renderSlot, createVNode, 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) => { for (const [key, val] of props) { sfc[key] = val; } return sfc; }; const _sfc_main = /* @__PURE__ */ defineComponent({ props: { icon: { type: String, default: "Bell" }, value: { type: [String, Number], default: "" }, max: { type: Number }, isDot: { type: Boolean, default: false } }, setup(__props) { return (_ctx, _cache) => { const _component_el_badge = resolveComponent("el-badge"); const _component_el_popover = resolveComponent("el-popover"); return openBlock(), createBlock(_component_el_popover, { "popper-class": "notification-popper-class", placement: "bottom", width: 300, trigger: "click" }, { default: withCtx(() => [ renderSlot(_ctx.$slots, "default", {}, void 0, true) ]), reference: withCtx(() => [ createVNode(_component_el_badge, { style: { "cursor": "pointer" }, 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"]) ]), _: 3 }); }; } }); var notification = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d33c25ac"]]); var index = { install(app) { app.component("cc-notification", notification); } }; export { index as default };