修改组件中hooks和store的调用方式

This commit is contained in:
wzy-warehouse
2026-05-07 12:53:25 +08:00
parent 2ab1b7da7c
commit 68715dea2b
32 changed files with 350 additions and 261 deletions
@@ -13,13 +13,15 @@
import { onMounted, watch } from 'vue';
import LoadingGeoserverLayer from '../../common/LoadingGeoserverLayer.vue';
const useStatus = useStatusStore();
// 保存图层引用
let populationLayer: ImageryLayer | null = null;
onMounted(() => {
// 监听显示
watch(
() => useStatusStore().poiLayers.showPopulationGrid.show,
() => useStatus.poiLayers.showPopulationGrid.show,
(newValue: boolean) => {
populationLayer!.show = newValue;
}