vue-baidu-map icon indicating copy to clipboard operation
vue-baidu-map copied to clipboard

vue3加载vue-baidu-map

Open tangbl-code opened this issue 1 year ago • 2 comments

import BaiduMap from 'vue-baidu-map' const app = createApp(App) app.use(BaiduMap, { // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */ ak: import.meta.env.VITE_GLOB_AK }) app.mount('#app') 这是我的使用方式 在页面提示了以下错误,是什么版本冲突的问题吗 Uncaught TypeError: Cannot set properties of undefined (setting '_BMap') at Object.install (vue-baidu-map.js?v=5ea57ad2:307:32) at Object.use (vue.js?v=6d93d747:5320:18) at main.ts:7:5

tangbl-code avatar Jan 09 '24 08:01 tangbl-code

import BaiduMap from 'vue-baidu-map' const app = createApp(App) app.use(BaiduMap, { // ak 是在百度地图开发者平台申请的核心参见http://lbsyun.baidu.com/ apiconsole/key */ ak: import.meta.env.VITE_GLOB_AK }) app.mount('#app') 这是我的使用方式, 页面提示了以下错误,版本冲突的问题是什么?Uncaught TypeError : Cannot set未定义的属性(设置'_BMap') 在Object.install(vue-baidu-map.js?v = 5ea57ad2:307:32) 在Object.use(vue.js?v = 6d93d747:5320:18) 在main。时间:7:5

这个是 vue2 的插件,很久没有更新了

evanhy avatar Jan 19 '24 07:01 evanhy

https://github.com/YangJianFei/vue-baidu-map-3x 试试这个3的版本

Nierifeng avatar Aug 15 '24 09:08 Nierifeng