UNPKG

cc-element-components

Version:

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

45 lines (44 loc) 1.15 kB
import { defineComponent, ref, onMounted, resolveComponent, openBlock, createBlock, mergeProps, unref } from "vue"; const _sfc_main = /* @__PURE__ */ defineComponent({ props: { percentage: { type: Number, required: true }, isAnimate: { type: Boolean, default: false }, time: { type: Number, default: 3e3 } }, setup(__props) { const props = __props; ref(0); let p = ref(0); onMounted(() => { if (props.isAnimate) { let t = Math.ceil(props.time / props.percentage); let timer = setInterval(() => { p.value += 1; if (p.value >= props.percentage) { p.value = props.percentage; clearInterval(timer); } }, t); } }); return (_ctx, _cache) => { const _component_el_progress = resolveComponent("el-progress"); return openBlock(), createBlock(_component_el_progress, mergeProps({ percentage: unref(p) }, _ctx.$attrs), null, 16, ["percentage"]); }; } }); var index = { install(app) { app.component("cc-progress", _sfc_main); } }; export { index as default };