yudao-init/src/mixins/fullscreen.js

24 lines
501 B
JavaScript
Raw Normal View History

2024-04-18 17:01:10 +08:00
import screenfull from "screenfull";
export default {
data() {
return {
isFullscreen: false,
};
},
watch: {
/** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */
isFullscreen(val) {
// 暴露一个全屏状态改变的回调函数
this.fullscreenCallback(val);
},
},
mounted() {
if (screenfull.isEnabled) {
screenfull.on("change", () => {
this.isFullscreen = screenfull.isFullscreen;
});
}
},
};