Browse Source

yvan-print

zhoucg 1 năm trước cách đây
mục cha
commit
3a08b2a47a
2 tập tin đã thay đổi với 4 bổ sung5 xóa
  1. 1 1
      src/components/yvan-editor/EditorMenu.vue
  2. 3 4
      src/utils/EditorUtils.ts

+ 1 - 1
src/components/yvan-editor/EditorMenu.vue

@@ -66,7 +66,7 @@ export default {
 <style lang="less" scoped>
 .yvan-print-designer-menu {
   position: fixed;
-  //width: 200px;
+  width: 100px;
   background-color: var(--yvan-color-primary-light-7);
   //border: 0.5px dotted var(--yvan-menu-bar-background);
   border-top-left-radius: 2px;

+ 3 - 4
src/utils/EditorUtils.ts

@@ -10,7 +10,6 @@ export default class EditorUtils {
     public static getEditorMenuPos(eleTop, eleLeft): { top, left } {
         const editorRect = EditorUtils.getEditorRect();
         const editorMenuWidthAndHeight = EditorUtils.getEditorMenuWidthAndHeight();
-        console.log('editorMenuWidthAndHeight >> ', editorMenuWidthAndHeight, eleLeft)
         if (editorRect) {
             return {
                 top: eleTop - editorRect.top - editorMenuWidthAndHeight?.height ?? 0 - 1,
@@ -31,9 +30,9 @@ export default class EditorUtils {
     public static getEditorMenuWidthAndHeight() {
         const editorMenuRect = EditorUtils.getEditorMenuObj()?.getBoundingClientRect();
         return {
-            width: editorMenuRect.right - editorMenuRect.left,
-            height: editorMenuRect.bottom - editorMenuRect.top
-        }
+            width: editorMenuRect.width !== 0 ? editorMenuRect.width : 27,
+            height: editorMenuRect.height !== 0 ? editorMenuRect.height : 200
+        };
     }
 
     public static showEditorMenu(elementRect) {