概况地图 尺寸变化 自适应 使用组件内部定义更新

This commit is contained in:
oldHome 2025-06-01 03:19:12 +08:00
parent d751a1897a
commit 90c15e81d4

View File

@ -1,6 +1,6 @@
<template>
<div class="h-100">
<map-box ref="mapbox" :key="mapBoxKey" />
<map-box ref="mapbox"/>
</div>
</template>
@ -11,7 +11,6 @@ export default {
name: 'Home',
data () {
return {
mapBoxKey: 0 // map-box
}
},
components: {
@ -63,16 +62,10 @@ export default {
}
},
/**
* @description: 侧边栏缩进有变化时 地图重新自适应
* @description: 侧边栏显隐
*/
isCollapse: {
handler (val) {
if (val) {
setTimeout(() => {
this.mapBoxKey++ // mapBoxKeymap-box
}, 500)
}
}
isCollapse () {
return this.$store.state.app.isCollapse
}
},
destroyed () {