share.vue 978 Bytes
<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>