修改
This commit is contained in:
parent
3d34172c58
commit
fb76f42760
@ -1,11 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="map-controller" :style="{ right: drawerOpen ? '480px' : '12px' }">
|
<div class="map-controller" :style="{ right: drawerOpen ? '480px' : '12px' }">
|
||||||
<div class="map-controller-group">
|
<div class="map-controller-group" v-for="item in controllers" :key="item.key">
|
||||||
<div class="map-controller-item" v-for="item in controllers" :key="item.key">
|
|
||||||
<a-tooltip :title="item.name" placement="left">
|
<a-tooltip :title="item.name" placement="left">
|
||||||
|
<div class="map-controller-item">
|
||||||
<i class="icon iconfont" :class="'icon-' + item.icon"></i>
|
<i class="icon iconfont" :class="'icon-' + item.icon"></i>
|
||||||
</a-tooltip>
|
|
||||||
</div>
|
</div>
|
||||||
|
</a-tooltip>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -18,25 +18,35 @@ const uiStore = useUiStore();
|
|||||||
const drawerOpen = ref(uiStore.drawerOpen);
|
const drawerOpen = ref(uiStore.drawerOpen);
|
||||||
|
|
||||||
// 监听 store 中的 drawerOpen 变化
|
// 监听 store 中的 drawerOpen 变化
|
||||||
watch(() => uiStore.drawerOpen, (newVal) => {
|
watch(
|
||||||
|
() => uiStore.drawerOpen,
|
||||||
|
(newVal) => {
|
||||||
drawerOpen.value = newVal;
|
drawerOpen.value = newVal;
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const isFullScreen = ref(false);
|
const isFullScreen = ref(false);
|
||||||
const mapType = ref("2D");
|
const mapType = ref("2D");
|
||||||
|
|
||||||
// 响应式的控制器配置
|
// 响应式的控制器配置
|
||||||
const controllers = ref([
|
const controllers = ref([
|
||||||
|
{
|
||||||
|
children: [
|
||||||
{
|
{
|
||||||
name: "全屏",
|
name: "全屏",
|
||||||
key: "fullScreen",
|
key: "fullScreen",
|
||||||
icon: isFullScreen.value ? "exitFullScreen" : "fullScreen",
|
icon: isFullScreen.value ? "exitFullScreen" : "fullScreen",
|
||||||
},
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: "定位",
|
name: "定位",
|
||||||
key: "positioning",
|
key: "positioning",
|
||||||
icon: "iconGlobal",
|
icon: "iconGlobal",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
children: [
|
||||||
{
|
{
|
||||||
name: "放大",
|
name: "放大",
|
||||||
key: "zoomIn",
|
key: "zoomIn",
|
||||||
@ -47,6 +57,8 @@ const controllers = ref([
|
|||||||
key: "zoomOut",
|
key: "zoomOut",
|
||||||
icon: "zoomOut",
|
icon: "zoomOut",
|
||||||
},
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "3D",
|
name: "3D",
|
||||||
key: "dim",
|
key: "dim",
|
||||||
@ -78,7 +90,6 @@ const controllers = ref([
|
|||||||
icon: "roaming",
|
icon: "roaming",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user