mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-12-24 13:12:59 +08:00
31 lines
685 B
Vue
31 lines
685 B
Vue
<template>
|
|
<div ref="domRef" class="w-full h-full"></div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { ref, onMounted } from 'vue';
|
|
import { useScriptTag } from '@vueuse/core';
|
|
import { GAODE_MAP_SDK_URL } from '@/config';
|
|
|
|
const { load } = useScriptTag(GAODE_MAP_SDK_URL);
|
|
|
|
const domRef = ref<HTMLDivElement>();
|
|
|
|
async function renderBaiduMap() {
|
|
if (!domRef.value) return;
|
|
await load(true);
|
|
const map = new AMap.Map(domRef.value, {
|
|
zoom: 11,
|
|
center: [114.05834626586915, 22.546789983033168],
|
|
viewMode: '3D'
|
|
});
|
|
// eslint-disable-next-line no-console
|
|
console.log('map: ', map);
|
|
}
|
|
|
|
onMounted(() => {
|
|
renderBaiduMap();
|
|
});
|
|
</script>
|
|
<style scoped></style>
|