diff --git a/src/views/layout/components/main/nofly/setNofly.vue b/src/views/layout/components/main/nofly/setNofly.vue index 60ffc95..48db50c 100644 --- a/src/views/layout/components/main/nofly/setNofly.vue +++ b/src/views/layout/components/main/nofly/setNofly.vue @@ -43,10 +43,20 @@ export default { }) } }, - isCollapse (val) { - if (val) { - this.$refs.mapbox.handleResize() - } + /** + * @description: 侧边栏缩进有变化时 地图重新自适应 + */ + isCollapse: { + handler (val) { + if (val) { + setTimeout(() => { + this.$nextTick(() => { + this.$refs.mapbox.handleResize() + }) + }, 500) + } + }, + deep: true } } } diff --git a/src/views/layout/components/main/nofly/setRestrictfly.vue b/src/views/layout/components/main/nofly/setRestrictfly.vue index 1e62f08..d0e0644 100644 --- a/src/views/layout/components/main/nofly/setRestrictfly.vue +++ b/src/views/layout/components/main/nofly/setRestrictfly.vue @@ -43,10 +43,20 @@ export default { }) } }, - isCollapse (val) { - if (val) { - this.$refs.mapbox.handleResize() - } + /** + * @description: 侧边栏缩进有变化时 地图重新自适应 + */ + isCollapse: { + handler (val) { + if (val) { + setTimeout(() => { + this.$nextTick(() => { + this.$refs.mapbox.handleResize() + }) + }, 500) + } + }, + deep: true } } }