yudao-init/src/mixins/fullscreen.js
DESKTOP-FUDKNA8\znjsz a262fb96d4 update home
2024-04-18 17:01:10 +08:00

24 lines
501 B
JavaScript

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;
});
}
},
};