From ddb1df24b17dd22e1fa088fa9fe8573913baec33 Mon Sep 17 00:00:00 2001 From: 刘嘉威 <daidaibg@163.com> Date: 星期五, 24 二月 2023 15:06:40 +0800 Subject: [PATCH] perf: 请求项目路径下文件问题 --- src/views/index/center-map.vue | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/index/center-map.vue b/src/views/index/center-map.vue index 4ed9922..a406a02 100644 --- a/src/views/index/center-map.vue +++ b/src/views/index/center-map.vue @@ -6,7 +6,7 @@ import type { MapdataType } from "./center.map"; const option = ref({}); const code = ref("china"); //china 浠h〃涓浗 鍏朵粬鍦板競鏄鏀跨紪鐮� -const centerMapRef = ref(); + withDefaults( defineProps<{ // 缁撴潫鏁板�� @@ -36,7 +36,6 @@ } }); await nextTick(); - centerMapRef.value?.resize(); option.value = optionHandle(regionCode, list, mapData); }; @@ -56,7 +55,7 @@ mapjson = mapjson.geoJSON; resolve(mapjson); } else { - mapjson = await GETNOBASE(`/map-geojson/${regionCode}.json`).then( + mapjson = await GETNOBASE(`./map-geojson/${regionCode}.json`).then( (data) => data ); code.value=regionCode @@ -98,6 +97,7 @@ :option="option" ref="centerMapRef" @click="mapClick" + v-if="JSON.stringify(option)!='{}'" /> </div> </div> @@ -147,7 +147,7 @@ } .mapwrap { - height: 548px; + height: 580px; width: 100%; // padding: 0 0 10px 0; box-sizing: border-box; -- Gitblit v1.8.0