UNPKG

yuang-framework-ui-pc

Version:

yuang-framework-ui-pc Library

66 lines (65 loc) 2.16 kB
import { defineComponent, ref, openBlock, createElementBlock, createElementVNode, createVNode, createCommentVNode } from "vue"; import SliderCaptcha from "./SliderCaptcha"; const _hoisted_1 = { key: 0, class: "yu-slider-captcha-dialog" }; const _hoisted_2 = /* @__PURE__ */ createElementVNode("div", { class: "yu-slider-captcha-dialog-modal" }, null, -1); const _hoisted_3 = { class: "yu-slider-captcha-dialog-wrapper" }; const _hoisted_4 = { class: "yu-slider-captcha-dialog yu-slider-captcha-slide-up" }; const _hoisted_5 = { class: "yu-slider-captcha" }; const _sfc_main = /* @__PURE__ */ defineComponent({ ...{ name: "YuSliderCaptchaDialog" }, __name: "index", emits: ["success", "fail", "close"], setup(__props, { expose: __expose, emit: __emit }) { const emit = __emit; const isShowSliderCaptcha = ref(false); const validateResult = ref(false); const showSliderCaptcha = () => { validateResult.value = false; isShowSliderCaptcha.value = true; }; const hideSliderCaptcha = () => { validateResult.value = false; isShowSliderCaptcha.value = false; }; const handleSuccess = (data) => { validateResult.value = true; emit("success", data); }; const handleFail = (data) => { validateResult.value = false; emit("fail", data); }; const handleClose = () => { hideSliderCaptcha(); emit("close"); }; __expose({ showSliderCaptcha, hideSliderCaptcha, validateResult }); return (_ctx, _cache) => { return isShowSliderCaptcha.value ? (openBlock(), createElementBlock("div", _hoisted_1, [ _hoisted_2, createElementVNode("div", _hoisted_3, [ createElementVNode("div", _hoisted_4, [ createElementVNode("div", _hoisted_5, [ createVNode(SliderCaptcha, { ref: "sliderCaptcha", onSuccess: handleSuccess, onFail: handleFail, onClose: handleClose }, null, 512) ]) ]) ]) ])) : createCommentVNode("", true); }; } }); export { _sfc_main as default };