前端vue使用screenfull包点击取消全屏
作者:互联网
安装
npm install --save screenfull
组件中引入并点击使用
import screenfull from "screenfull";
methods: {
handleFullScreen() {
// 判断是否支持
if (!screenfull.enabled) {
this.$message({
message: "不支持全屏",
type: "warning"
});
return false;
}
screenfull.toggle();
},
}
标签:handleFullScreen,vue,false,点击,全屏,screenfull,message 来源: https://blog.csdn.net/weixin_56806542/article/details/121145091