修改组件中store的调用方式
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
import { onMounted, watch } from 'vue';
|
||||
import LoadingGeoserverLayer from '../../common/LoadingGeoserverLayer.vue';
|
||||
|
||||
const useStatus = useStatusStore();
|
||||
const statusStore = useStatusStore();
|
||||
|
||||
// 保存图层引用
|
||||
let mainRoadLayer: ImageryLayer | null = null;
|
||||
@@ -21,7 +21,7 @@
|
||||
onMounted(() => {
|
||||
// 监听显示隐藏
|
||||
watch(
|
||||
() => useStatus.infrastructureLayers.showMainRoad.show,
|
||||
() => statusStore.infrastructureLayers.showMainRoad.show,
|
||||
(newValue: boolean) => {
|
||||
mainRoadLayer!.show = newValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user