html
<el-button icon="el-icon-monitor" circle size="small" @click="fullScreen"></el-button>
vue.js (操作dom元素来实现页面全屏)
methods: {
// 全屏切换
fullScreen () {
let isFullScreen = document.fullscreenElement
if (!isFullScreen) {
document.documentElement.requestFullscreen()
} else {
document.exitFullscreen()
}
},
}