1 |
- var u=(e,r,t)=>new Promise((o,n)=>{var s=a=>{try{p(t.next(a))}catch(c){n(c)}},i=a=>{try{p(t.throw(a))}catch(c){n(c)}},p=a=>a.done?o(a.value):Promise.resolve(a.value).then(s,i);p((t=t.apply(e,r)).next())});import{u as l}from"./useScript.2926a59d.js";import{av as d,a as f,s as m,M as h,o as w,h as B,bk as _,ak as M,i as v}from"./index.32452443.js";const g="https://api.map.baidu.com/getscript?v=3.0&ak=OaBvYmKX3pjF7YFUFeeBCeGdy9Zp7xB2&services=&t=20210201100830&s=1",k=f({name:"BaiduMap",props:{width:{type:String,default:"100%"},height:{type:String,default:"calc(100vh - 78px)"}},setup(){const e=m(null),{toPromise:r}=l({src:g});function t(){return u(this,null,function*(){yield r(),yield M();const o=v(e);if(!o)return;const n=window.BMap,s=new n.Map(o),i=new n.Point(116.404,39.915);s.centerAndZoom(i,15),s.enableScrollWheelZoom(!0)})}return h(()=>{t()}),{wrapRef:e}}});function y(e,r,t,o,n,s){return w(),B("div",{ref:"wrapRef",style:_({height:e.height,width:e.width})},null,4)}var b=d(k,[["render",y]]);export{b as default};
|