Selaa lähdekoodia

Table: fix a style bug when fixed=right. (#1651)

FuryBean 8 vuotta sitten
vanhempi
commit
2dd2c79365
2 muutettua tiedostoa jossa 12 lisäystä ja 1 poistoa
  1. 4 1
      packages/table/src/table.vue
  2. 8 0
      packages/theme-default/src/table.css

+ 4 - 1
packages/table/src/table.vue

@@ -67,7 +67,7 @@
       :style="{
         width: layout.rightFixedWidth ? layout.rightFixedWidth + 'px' : '',
         height: layout.viewportHeight ? layout.viewportHeight + 'px' : '',
-        right: layout.scrollY ? layout.gutterWidth + 'px' : ''
+        right: layout.scrollY ? (border ? layout.gutterWidth : (layout.gutterWidth || 1)) + 'px' : '' 
       }">
       <div class="el-table__fixed-header-wrapper" ref="rightFixedHeaderWrapper" v-if="showHeader">
         <table-header
@@ -93,6 +93,9 @@
         </table-body>
       </div>
     </div>
+    <div class="el-table__fixed-right-patch" 
+      v-if="rightFixedColumns.length > 0"
+      :style="{ width: layout.scrollY ? layout.gutterWidth + 'px' : '0', height: layout.headerHeight + 'px' }"></div>
     <div class="el-table__column-resize-proxy" ref="resizeProxy" v-show="resizeProxyVisible"></div>
   </div>
 </template>

+ 8 - 0
packages/theme-default/src/table.css

@@ -154,6 +154,14 @@
       }
     }
 
+    @e fixed-right-patch {
+      position: absolute;
+      top: -1px;
+      right: 0;
+      background-color: var(--table-header-background);
+      border-bottom: 1px solid var(--table-border-color);
+    }
+
     @e fixed-right {
       top: 0;
       left: auto;