安装依赖 npm i @amap/amap-jsapi-loader --save
封装的高德地图组件
<script setup lang="ts">
import type {PropType} from "vue";
let AMapLoader:any=null;
if (import.meta.client){
AMapLoader =await import("@amap/amap-jsapi-loader")
}
const {plugins,mapOption,enableLoca} = defineProps({
plugins: {
type: Array as PropType<MapPluginEnum[]>,
default: () => [MapPluginEnum.Geolocation, MapPluginEnum.GeoJSON, MapPlugin