share.vue
978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<template>
<div class="info-content">
<mapContent ref="mapContentRefs">
<template #mapBox>
<div id="shareContainer" class="map-container"></div>
</template>
</mapContent>
<slot></slot>
</div>
</template>
<script>
import { ref, defineComponent, onMounted } from "vue";
import mapContent from "@/components/mapContent.vue";
// import AMapLoader from "@amap/amap-jsapi-loader";
import { CONSTANT } from "../constant";
export default defineComponent({
name: "SharePage",
components: {
mapContent,
},
setup() {
const mapContentRefs = ref(null);
onMounted(() => {
mapContentRefs.value.initMap("shareContainer");
// AMapLoader.load({
// key: CONSTANT.MAP_KEY,
// version: "1.4.8",
// plugins: CONSTANT.MAP_PLUGINS,
// }).then((AMap) => {
// window.AMap = AMap;
// });
});
return {
mapContentRefs,
};
},
});
</script>
<style lang="scss" scoped></style>