mpvue引入vue-amap报错
在mpvue中如何使用高德地图
引入了vue-amap报错Cannot read property 'AMap' of undefined
import VueAMap from 'vue-amap';
Vue.use(VueAMap);
VueAMap.initAMapApiLoader({
key: 'b8f04aa5ba51b2d24b92fe4e8903e40f',
plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor'],
// 默认高德 sdk 版本为 1.4.4
v: '1.4.4'
});
"mpvue": "^1.0.11",
"vue-amap": "^0.5.8",
VM423:1 thirdScriptError
sdk uncaught third Error
Cannot read property 'AMap' of undefined
TypeError: Cannot read property 'AMap' of undefined
at t.load (http://127.0.0.1:46963/appservice/common/vendor.js:7886:40)
at Object.s [as initAMapApiLoader] (http://127.0.0.1:46963/appservice/common/vendor.js:6688:67)
at Object.<anonymous> (http://127.0.0.1:46963/appservice/app.js:22:52)
at __webpack_require__ (http://127.0.0.1:46963/appservice/common/manifest.js:71:31)
at Object.webpackJsonpCallback [as webpackJsonp] (http://127.0.0.1:46963/appservice/common/manifest.js:38:26)
at http://127.0.0.1:46963/appservice/app.js:5:8
at require (http://127.0.0.1:46963/appservice/__dev__/WAService.js:22:26841)
at http://127.0.0.1:46963/appservice/appservice?t=1541426190666:1205:9
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也出现这个问题 不知道lz解决了么 如何处理的