Browse Source

Table: transparent border when loading (#10254)

杨奕 7 năm trước cách đây
mục cha
commit
2098e36b51
2 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 5 1
      packages/loading/src/directive.js
  2. 1 1
      packages/theme-chalk/src/table.scss

+ 5 - 1
packages/loading/src/directive.js

@@ -26,7 +26,11 @@ loadingDirective.install = Vue => {
 
             ['top', 'left'].forEach(property => {
               const scroll = property === 'top' ? 'scrollTop' : 'scrollLeft';
-              el.maskStyle[property] = el.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] + 'px';
+              el.maskStyle[property] = el.getBoundingClientRect()[property] +
+                document.body[scroll] +
+                document.documentElement[scroll] -
+                parseInt(getStyle(document.body, `margin-${ property }`), 10) +
+                'px';
             });
             ['height', 'width'].forEach(property => {
               el.maskStyle[property] = el.getBoundingClientRect()[property] + 'px';

+ 1 - 1
packages/theme-chalk/src/table.scss

@@ -282,7 +282,7 @@
     border-bottom: none;
 
     &.el-loading-parent--relative {
-      border: none;
+      border-color: transparent;
     }
 
     th, td {