UNPKG

mine-h5-ui

Version:

一款轻量级、模块化基于 Vue3.x 的 H5 前端 UI 组件库 👍

49 lines (48 loc) 1.57 kB
import { defineComponent as c, openBlock as o, createElementBlock as s, normalizeClass as h, unref as e, renderSlot as y, Fragment as m, createTextVNode as r, toDisplayString as a, createCommentVNode as n } from "vue"; import { useCountdown as D } from "./hooks.js"; import { name as i } from "./config.js"; const C = /* @__PURE__ */ c({ name: i, __name: "index", props: { time: { default: 0 }, format: { default: "hh:mm:ss" }, isStart: { type: Boolean, default: !0 }, isSuspend: { type: Boolean, default: !1 }, isReset: { type: Boolean, default: !1 } }, emits: ["end", "progress"], setup(d, { emit: l }) { const u = l, f = d, { formatAfter: t } = D(f, u); return (p, k) => (o(), s("div", { class: h(e(i)) }, [ y(p.$slots, "default", { DD: e(t).DD, hh: e(t).hh, mm: e(t).mm, ss: e(t).ss, ms: e(t).ms }, () => [ e(t).DD !== void 0 ? (o(), s(m, { key: 0 }, [ r(a(e(t).DD) + " 天", 1) ], 64)) : n("", !0), e(t).hh !== void 0 ? (o(), s(m, { key: 1 }, [ r(a(e(t).hh) + " 时", 1) ], 64)) : n("", !0), e(t).mm !== void 0 ? (o(), s(m, { key: 2 }, [ r(a(e(t).mm) + " 分", 1) ], 64)) : n("", !0), e(t).ss !== void 0 ? (o(), s(m, { key: 3 }, [ r(a(e(t).ss) + " 秒", 1) ], 64)) : n("", !0), e(t).ms !== void 0 ? (o(), s(m, { key: 4 }, [ r(a(e(t).ms) + " 毫秒", 1) ], 64)) : n("", !0) ]) ], 2)); } }); export { C as default };