首先 定义一个按钮
<div class="con" @click="fullScreen">
<a-icon type="fullscreen" style="font-size: 18px; margin: 1px 5px 0 0" />
<div>全屏</div>
</div>
// 全屏
fullScreen() {
let element = document.getElementById('map-container')
if (element.requestFullscreen) {
element.requestFullscreen()
} else if (element.webkitRequestFullScreen) {
element.webkitRequestFullScreen()
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen()
} else if (element.msRequestFullscreen) {
element.msRequestFullscreen()
}
this.fullscreen = !this.fullscreen
},