types.46b50de9.js 715 B

1
  1. import{x as n,aO as v,v as R,y as A,A as S,z as T,m as h}from"./index.js";function x(e,o){const a=n({}),d=v(),i=n(null),p=n(!1),r=n(""),f=R().emit,y=()=>h(i).$el.getBoundingClientRect().y;async function g(){const{api:t,prop:c,value:s}=e,{code:u,message:m,data:l}=await t({[c]:Array.isArray(s)?s[0]:s});d({code:u,message:m,handler:()=>{a.value=l,r.value=String(u),o&&o(l)}})}return A(()=>{if(e.api&&!e.noRequeset)return g()}),S(()=>a.value,()=>setTimeout(()=>{const t={top:y()-134,title:e.title};T(()=>f("map-offset-top",t))},1e3)),{defaultRef:i,hidden:p,code:r,data:a}}const O={api:{type:Function},prop:{type:String},value:{type:[String,Array]},title:{type:String},noRequeset:{type:Boolean}};export{O as d,x as u};