共计 439 个字符,预计需要花费 2 分钟才能阅读完成。
装置:
npm install --save screenfull
利用:
import screenfull from 'screenfull'
export default {
name: 'test',
data() {
return {screenfullBut: false, // 全屏按钮}
},
methods: {
// 全屏性能
fullscreen() {if (!screenfull.isEnabled) {
this.$notification.open({
message: '舒适提醒',
description:
'您的浏览器无奈应用全屏性能,请更换谷歌浏览器或者请手动点击 F11 按钮全屏展现!',
duration: 10,
placement: 'bottomLeft',
});
return false
}
screenfull.toggle();
if(screenfull.isFullscreen){this.screenfullBut = false;}else{this.screenfullBut = true;}
},
}
}
正文完