import{r as e,e as a,f as l,w as t,g as u,x as o,l as r,v as s,A as v,y as n,p as d}from"./index-DVkgSHpn.js";const p={__name:"el-code",props:{modelValue:{type:Boolean,default:!0},color:{type:String,default:"#000"},activeColor:{type:String,default:"#666"},fontSize:{type:String,default:"28rpx"},timer:{type:Number,default:60}},emits:["modelValue","update:modelValue","change"],setup(p,{expose:i,emit:m}){const c=p,f=m;let y=e(c.timer),V=e(!1),g=e(),x=e("获取验证码");return i({start:()=>{clearInterval(g.value),g.value=setInterval((()=>{y.value--,V.value=!0,x.value=y.value+"秒后重发",y.value<=0?(clearInterval(g.value),f("update:modelValue",!0),V.value=!1,y.value=c.timer,x.value="重新获取"):f("update:modelValue",!1)}),1e3)},stop:()=>{clearInterval(g.value),f("update:modelValue",!0),V.value=!1,y.value=c.timer,x.value="获取验证码"}}),(e,i)=>{const m=n,c=d;return a(),l(c,null,{default:t((()=>[u(m,{style:o({color:r(V)?p.activeColor:p.color,"font-size":p.fontSize})},{default:t((()=>[s(v(r(x)),1)])),_:1},8,["style"])])),_:1})}}};export{p as _};
//# sourceMappingURL=el-code.niKIdtJO.js.map
