9、Gantt 全屏&取消全屏操作

 1 const ganttData = reactive<{
 2   // 全屏开启状态
 3   fullScreenStatus: boolean;
 4 }>({
 5   fullScreenStatus: false,
 6 });
 7 
 8 function collapseExpandFullFuc() {
 9   ganttData.fullScreenStatus = gantt.getState().fullscreen;
10 }
11 
12 /**
13  * 开启关闭 & 关闭全屏
14  */
15 function handleFullscreen() {
16   if (!gantt.getState().fullscreen) {
17     // expanding the gantt to full screen
18     gantt.expand();
19     ganttData.fullScreenStatus = true;
20   } else {
21     // collapsing the gantt to the normal mode
22     gantt.collapse();
23     ganttData.fullScreenStatus = false;
24   }
25 }
26 
27 gantt.plugins({
28     fullscreen: true
29 });
1、将甘特图扩展为全屏模式
1 gantt.attachEvent('onExpand', function () {
2   collapseExpandFullFuc();
3 });
2、将甘特图从全屏模式折叠到正常模式
1 gantt.attachEvent('onCollapse', function () {
2   collapseExpandFullFuc();
3 });
3、全屏扩展
 

 
 
 
 
 
 

posted @ 2021-11-16 17:35  你在说啥  阅读(319)  评论(0)    收藏  举报