Map.vue

<template>
<div class="Map" :style="{
height: this.height+'px',
width:this.width+ 'px'
}">
<div attribute to limit CSS to this component only -->
<style scoped>
#allmap {
height: 100%;
width: 100%;
}
</style>

map.js

export function MP(ak) {
  return new Promise(function (resolve, reject) {
    window.init = function () {
      resolve(BMap)
    }
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src = "http://api.map.baidu.com/api?v=2.0&ak="+ak+"&callback=init";
    script.onerror = reject;
    document.head.appendChild(script);
  })
}

 

你们的支持,是我坚持的动力~

 

相关文章:

  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2022-12-23
  • 2021-07-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-03
  • 2021-09-15
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
相关资源
相似解决方案