1.先安装好vue百度地图
这是一个组件
<template>
<div>
<baidu-map :center="center" :scroll-wheel-zoom="true" :zoom="zoom" :style="{ height: height, width: width }" @ready="initMap" @click="handler">
<bm-marker :position="point" :dragging="true">
<bm-label :label-style="{ color: 'red', fontSize: '14px' }" :offset="{ width: 20, height: -15 }" content="位置" />
</bm-marker>
</baidu-map>
</div>
</template>
<script>
export default {
name: 'BaiduMapPoint',
props: {
placeholder: {
type: String,
default: ''
},
// eslint-disable-next-line vue/require-default-prop
zoom: {
type: Number,
default: 18
},
width: {
type: String,
default: '100%'
},
height: {