Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue3加载vue-baidu-map #1040

Open
tangbl-code opened this issue Jan 9, 2024 · 2 comments
Open

vue3加载vue-baidu-map #1040

tangbl-code opened this issue Jan 9, 2024 · 2 comments

Comments

@tangbl-code
Copy link

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

@evanhy
Copy link

evanhy commented Jan 19, 2024

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 的插件,很久没有更新了

@Nierifeng
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants