ZhangXianQiang
2024-03-08 310156b7244cd7b0c1b958f4267b5cf4e12bd90a
fix:修改获取实例
1个文件已修改
6 ■■■■■ 已修改文件
src/views/daoAnOffice/center/map.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/daoAnOffice/center/map.vue
@@ -42,7 +42,7 @@
</template>
<script setup>
import { onMounted, ref,getCurrentInstance } from 'vue';
import { onMounted, ref, getCurrentInstance } from 'vue';
import AMapLoader from '@amap/amap-jsapi-loader';
import DialogType1 from './dialog/dialog-type1.vue';
@@ -80,7 +80,7 @@
// dialog集合
const dialogList = ref({});
// 获取当前实例
const {ctx} = getCurrentInstance();
let ctx = null;
let mapInstance = null;
let trafficLayer = null;;
@@ -285,6 +285,8 @@
onMounted(() => {
  // 获取当前实例
  ctx = getCurrentInstance().ctx;
  AMapLoader.load({
    key: "2898109c22191c3969957500934169dc", //申请好的 Web 端开发者 Key,首次调用 load 时必填
    version: "2.0", //指定要加载的 JS API 的版本,缺省时默认为 1.4.15