UNPKG

hu-element-components

Version:

45 lines (44 loc) 1.13 kB
import { defineComponent as p, ref as s, onMounted as l, resolveComponent as c, createBlock as i, openBlock as m, mergeProps as u, unref as f } from "vue"; const _ = /* @__PURE__ */ p({ __name: "index", props: { percentage: { type: Number, default: 0 }, isAnimation: { type: Boolean, default: !1 }, time: { type: Number, default: 3e3 } }, setup(n) { let e = n, t = s(0); return l(() => { if (e.isAnimation) { let r = Math.ceil(e.time / e.percentage), o = setInterval(() => { t.value += 1, t.value >= e.percentage && (t.value = e.percentage, clearInterval(o)); }, r); } else t.value = e.percentage; }), (r, o) => { const a = c("el-progress"); return m(), i(a, u(r.$attrs, { percentage: f(t) }), null, 16, ["percentage"]); }; } }), g = (n, e) => { const t = n.__vccOpts || n; for (const [r, o] of e) t[r] = o; return t; }, d = /* @__PURE__ */ g(_, [["__scopeId", "data-v-6de51e80"]]), x = { install(n) { n.component("m-progress", d); } }; export { x as default };