UNPKG

yanzhen-design-vue

Version:

58 lines (57 loc) 2.26 kB
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, createBlock, createCommentVNode, createElementVNode, toDisplayString, withCtx } from "vue"; import { Progress, Tooltip } from "ant-design-vue"; import "../../../hooks/index.mjs"; import { progressTxtName, progressTxtProps, progressTxtOptions } from "./progress-txt.mjs"; import { useProgress } from "../../../hooks/use-progress/index.mjs"; const _sfc_main = /* @__PURE__ */ defineComponent({ ...{ name: progressTxtName }, __name: "progress-txt", props: progressTxtProps, setup(__props) { const { ns } = progressTxtOptions; const props = __props; const { progressBarNum, showProgress } = useProgress(props); return (_ctx, _cache) => { return !props.showTooltip ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass([unref(ns).b()]) }, [ unref(showProgress) ? (openBlock(), createBlock(unref(Progress), { key: 0, percent: unref(progressBarNum), "show-info": false, "stroke-color": "#1890ff", class: normalizeClass([unref(ns).e("progress")]) }, null, 8, ["percent", "class"])) : createCommentVNode("", true), createElementVNode("span", { class: normalizeClass([unref(ns).e("text")]) }, toDisplayString(_ctx.value), 3) ], 2)) : (openBlock(), createBlock(unref(Tooltip), { key: 1, title: _ctx.value, placement: "top" }, { default: withCtx(() => [ createElementVNode("div", { class: normalizeClass([unref(ns).b()]) }, [ unref(showProgress) ? (openBlock(), createBlock(unref(Progress), { key: 0, percent: unref(progressBarNum), "show-info": false, "stroke-color": "#1890ff", class: normalizeClass([unref(ns).e("progress")]) }, null, 8, ["percent", "class"])) : createCommentVNode("", true), createElementVNode("span", { class: normalizeClass([unref(ns).e("text")]) }, toDisplayString(props.value), 3) ], 2) ]), _: 1 }, 8, ["title"])); }; } }); export { _sfc_main as default };