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