//最外层div上 class="fullScreenBox"
.fullScreenBox {
height: 100%;
width: 100%;
}
<el-row>
<el-button type="primary" v-if="fullScreenSwitch" @click="fullScreenFn">
<div>
<p style="color:#fff">全 屏</p>
</div>
</el-button>
<el-button type="primary" v-else @click="goBack">
<div>
<p style="color:#fff">退 出</p>
</div>
</el-button>
</el-row>
private fullScreenSwitch: boolean = true
// 全屏
private async fullScreenFn() {
$('.fullScreenBox').css({ position: 'fixed', top: '0px', left: '0px' })
this.fullScreenSwitch = !this.fullScreenSwitch
}
private async goBack() {
$('.fullScreenBox').css({ position: 'relative' })
this.fullScreenSwitch = !this.fullScreenSwitch
}