baidu-map-vue3
BaiduMap Vue3 GL Map Component
安装
npm install --save baidu-map-vue3
// 或者
yarn add baidu-map-vue3
全局导入
import { createApp } from 'vue'
import App from './App.vue'
import BaiduMapVue3 from 'baidu-map-vue3'
const app = createApp(App)
app.use(BaiduMapVue3, {
apiKey: apiKey,
})
app.mount('#app')
Volar 支持
如果您使用Volar,需要在tsconfig.json中通过compilerOptions.types指定全局组件类型。
// tsconfig.json
{
"compilerOptions": {
// ...
"types": ["baidu-map-vue3/typings/global"]
}
}
局部导入
<template>
<baidu-map
class="map"
ref="map"
:apiKey="apiKey"
:center="point"
>
</baidu-map>
</template>
<script setup lang="ts">
import { BaiduMap } from 'baidu-map-vue3'
const point = ref({
lng: 116.403963,
lat: 39.915119,
})
</script>
<style lang="less">
.map {
width: 100%;
height: 400px;
}
</style>
License
Licensed under the MIT License
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.4.9 | ^3.2.26 | MIT | |
| 0.4.8 | ^3.2.26 | MIT | |
| 0.4.7 | ^3.2.26 | MIT | |
| 0.4.6 | ^3.2.26 | MIT | |
| 0.4.5 | ^3.2.26 | MIT | |
| 0.4.3 | ^3.2.26 | MIT | |
| 0.4.2 | ^3.2.26 | MIT | |
| 0.4.1 | ^3.2.26 | MIT | |
| 0.4.0 | ^3.2.26 | MIT | |
| 0.3.9 | ^3.2.26 | MIT | |
| 0.3.8 | ^3.2.26 | MIT | |
| 0.3.7 | ^3.2.26 | MIT | |
| 0.3.6 | ^3.2.26 | MIT | |
| 0.3.5 | ^3.2.26 | MIT | |
| 0.3.4 | ^3.2.26 | MIT | |
| 0.3.3 | ^3.2.26 | ||
| 0.3.2 | ^3.2.26 | ||
| 0.3.1 | ^3.2.26 | ||
| 0.3.0 | ^3.2.26 | ||
| 0.2.9 | ^3.2.26 | ||
| 0.2.8 | ^3.2.26 | ||
| 0.2.7 | ^3.2.26 | ||
| 0.2.6 | ^3.2.26 | ||
| 0.2.5 | ^3.2.26 | ||
| 0.2.4 | ^3.2.26 | ||
| 0.2.3 | ^3.2.26 | ||
| 0.2.2 | ^3.2.26 | ||
| 0.2.1 | ^3.2.26 | ||
| 0.2.0 | ^3.2.26 |