import{G as v}from"./index-CL6hUm94.js";import{S as T,G as w,a7 as B,av as z}from"./antd-B7v2hwFR.js";import{f as i,q as D,a2 as c,a5 as r,k as t,aa as a,n as G,u as d,G as u,F as S,aj as $,a9 as F,ad as N,H as V}from"./vue-DApy1uhY.js";const j={class:"loading-wrapper"},q=["loading-full"],A={__name:"loading",setup(E){const p=i(!1),m=i(!1),s=i(1e3),k=i(["pulse","rect","plane","cube","preloader","chase","dot"]);function g(o){m.value=o===2,p.value=!0,setTimeout(()=>{p.value=!1},2e3)}function y(o){const{open:e,close:n}=v({spin:o});e(),setTimeout(()=>{n()},2e3)}function b(){const{open:o,close:e}=v({minTime:s.value});o(),e()}return(o,e)=>{const n=w,f=T,_=B,C=z,x=D("loading");return r(),c("div",j,[t(_,{title:"指令方式加载loading",hoverable:!0,bordered:!1},{default:a(()=>[G((r(),c("div",{class:"relative w-full h-[150px]","loading-text":"自定义指令loading","loading-spin":"pulse","loading-full":d(m)},[t(f,{size:15},{default:a(()=>[t(n,{type:"primary",onClick:e[0]||(e[0]=l=>g(1))},{default:a(()=>e[3]||(e[3]=[u(" v-loading指令全屏 ")])),_:1}),t(n,{type:"primary",onClick:e[1]||(e[1]=l=>g(2))},{default:a(()=>e[4]||(e[4]=[u(" v-loading指令非全屏 ")])),_:1})]),_:1})],8,q)),[[x,d(p)]])]),_:1}),t(_,{title:"hook加载loading",hoverable:"",bordered:!1,style:{"margin-top":"15px"}},{default:a(()=>[t(f,{size:15},{default:a(()=>[(r(!0),c(S,null,$(d(k),(l,L)=>(r(),F(n,{key:l,type:"primary",onClick:H=>y(l)},{default:a(()=>[u(" loading"+N(L+1),1)]),_:2},1032,["onClick"]))),128))]),_:1})]),_:1}),t(_,{title:"hooloading最小时长",hoverable:"",bordered:!1},{default:a(()=>[t(f,{size:15},{default:a(()=>[t(C,{value:d(s),"onUpdate:value":e[2]||(e[2]=l=>V(s)?s.value=l:null)},null,8,["value"]),t(n,{type:"primary",onClick:b},{default:a(()=>e[5]||(e[5]=[u(" 点击触发loading ")])),_:1})]),_:1})]),_:1})])}}};export{A as default};
