UNPKG

quick-admin-vue3-core

Version:

以快(计算机执行效率、开发效率)为核心的后台管理系统开发模板

39 lines (38 loc) 1.38 kB
import { defineComponent as i, ref as l, resolveComponent as _, createBlock as v, openBlock as a, normalizeClass as d, withCtx as h, createElementBlock as o, Fragment as s, createTextVNode as c, toDisplayString as C } from "vue"; import { W as r } from "./platform-DsTwHxm6.js"; import { _ as k } from "./_plugin-vue_export-helper-CHgC5LLL.js"; const p = 5, x = /* @__PURE__ */ i({ __name: "CaptchaBtn", props: { exampleProp: { default: () => ({}) } }, setup(y) { const t = l(p), e = l(!1); let n = null; function u(f) { e.value ? r.warning("验证码已发送,请稍后再试") : (e.value = !0, n = setInterval(() => { t.value -= 1, t.value < 1 && (e.value = !1, t.value = p, clearInterval(n)); }, 1e3), r.success("验证码已发送,请注意查收")); } return (f, B) => { const m = _("el-button"); return a(), v(m, { onClick: u, class: d(["captcha-btn", { "has-send": e.value }]), type: "primary" }, { default: h(() => [ e.value ? (a(), o(s, { key: 0 }, [ c("已发送(" + C(t.value) + ")", 1) ], 64)) : (a(), o(s, { key: 1 }, [ c("发送验证码") ], 64)) ]), _: 1 }, 8, ["class"]); }; } }), S = /* @__PURE__ */ k(x, [["__scopeId", "data-v-ff0f5ff2"]]); export { S as default };