赞
踩
一、下载插件
npm install --save screenfull
二、在页面中进行引入
import screenfull from ‘screenfull'
<el-button :plain="true" @click="screen">全屏</el-button>
三、
- const fullScreen = ref(false)
- import { ElMessage } from 'element-plus'
-
-
- const screen = () => {
- if(!screenfull.enabled) {
- ElMessage('您的浏览器不能全屏')
- return false
- }
- screenfull.toggle()
- // ElMessage('全屏啦')
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。