2727 </template >
2828 </div >
2929 </slot >
30-
30+
3131 </div >
3232 <div class =" q-editor-nav-menu-right" >
3333 <slot name =right ></slot >
@@ -42,15 +42,15 @@ import { NodeType } from '@quantum-lowcode/schemas';
4242import { Divider , Button , Tooltip } from ' ant-design-vue' ;
4343import { isFunction } from ' @quantum-lowcode/utils' ;
4444defineOptions ({
45- name: ' QEditorNavMenu' ,
45+ name: ' QEditorNavMenu'
4646});
4747
4848const props = withDefaults (
4949 defineProps <{
5050 btnList? : IMenuItem [];
5151 }>(),
5252 {
53- btnList : () => [],
53+ btnList : () => []
5454 }
5555);
5656
@@ -63,18 +63,18 @@ const workspaceCenter = computed((): number => uiService?.get('workspaceCenter')
6363
6464const leftStyle = computed (() => {
6565 if (workspaceLeft .value === 1 ) {
66- return {flex: 1 }
66+ return {flex: 1 };
6767 }
6868 return {
69- width: workspaceLeft .value + ' px' ,
70- }
71- })
69+ width: workspaceLeft .value + ' px'
70+ };
71+ });
7272const getCenterStyle = computed (() => {
73- if (workspaceCenter .value === 1 ) {
74- return { flex: 1 };
75- }
76- return { width: workspaceCenter .value + ' px' };
77- });
73+ if (workspaceCenter .value === 1 ) {
74+ return { flex: 1 };
75+ }
76+ return { width: workspaceCenter .value + ' px' };
77+ });
7878
7979const isMac = / mac os x/ .test (navigator .userAgent .toLowerCase ());
8080const ctrl = isMac ? ' Command' : ' Ctrl' ;
@@ -86,7 +86,7 @@ function get_config(item: IMenuItem) {
8686 const config: IMenuButton [] = [];
8787 switch (item ) {
8888 case ' /' :
89- config .push ({type: ' divider' , });
89+ config .push ({type: ' divider' });
9090 break ;
9191 case ' zoom' :
9292 config .push (
@@ -106,7 +106,7 @@ function get_config(item: IMenuItem) {
106106 onClick : () => {
107107 const node = services ?.editorService .get (' node' );
108108 node && services ?.editorService .delete (node );
109- },
109+ }
110110 });
111111 break ;
112112 case ' undo' :
@@ -115,7 +115,7 @@ function get_config(item: IMenuItem) {
115115 icon: ' ArrowLeftOutlined' ,
116116 tooltip: ` 后退(${ctrl }+z) ` ,
117117 disabled : () => ! services ?.historyService .state .canUndo ,
118- onClick : () => services ?.editorService .undo (),
118+ onClick : () => services ?.editorService .undo ()
119119 });
120120 break ;
121121 case ' redo' :
@@ -125,45 +125,45 @@ function get_config(item: IMenuItem) {
125125 icon: ' ArrowRightOutlined' ,
126126 tooltip: ` 前进(${ctrl }+Shift+z) ` ,
127127 disabled : () => ! services ?.historyService .state .canRedo ,
128- onClick : () => services ?.editorService .redo (),
128+ onClick : () => services ?.editorService .redo ()
129129 });
130130 break ;
131131 case ' zoom-in' :
132132 config .push ({
133133 type: ' button' ,
134134 icon: ' ZoomInOutlined' ,
135135 tooltip: ` 放大(${ctrl }+=) ` ,
136- onClick : () => uiService ?.zoom (0.1 ),
136+ onClick : () => uiService ?.zoom (0.1 )
137137 });
138138 break ;
139139 case ' zoom-out' :
140140 config .push ({
141141 type: ' button' ,
142142 icon: ' ZoomOutOutlined' ,
143143 tooltip: ` 縮小(${ctrl }+-) ` ,
144- onClick : () => uiService ?.zoom (- 0.1 ),
144+ onClick : () => uiService ?.zoom (- 0.1 )
145145 });
146146 break ;
147147 case ' scale-to-fit' :
148148 config .push ({
149149 type: ' button' ,
150150 icon: ' BorderInnerOutlined' ,
151151 tooltip: ` 缩放以适应(${ctrl }+0) ` ,
152- onClick : async () => uiService ?.set (' zoom' , await uiService .calcZoom ()),
152+ onClick : async () => uiService ?.set (' zoom' , await uiService .calcZoom ())
153153 });
154154 break ;
155155 case ' scale-to-original' :
156156 config .push ({
157157 type: ' button' ,
158158 icon: ' BorderOuterOutlined' ,
159159 tooltip: ` 缩放到实际大小(${ctrl }+1) ` ,
160- onClick : () => uiService ?.set (' zoom' , 1 ),
160+ onClick : () => uiService ?.set (' zoom' , 1 )
161161 });
162162 break ;
163163 default :
164164 config .push ({
165165 type: ' text' ,
166- text: item ,
166+ text: item
167167 });
168168 break ;
169169 }
0 commit comments