Skip to content

Commit 768606a

Browse files
committed
Table: fix layout breaks when append slot exists
1 parent 1d1fcdd commit 768606a

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

packages/table/src/table.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@
123123
<div
124124
v-if="$slots.append"
125125
class="el-table__append-gutter"
126-
:style="{
127-
height: layout.appendHeight + 'px'
128-
}"></div>
126+
:style="{ height: layout.appendHeight + 'px'}"></div>
129127
</div>
130128
<div
131129
v-if="showSummary"
@@ -183,6 +181,10 @@
183181
width: bodyWidth
184182
}">
185183
</table-body>
184+
<div
185+
v-if="$slots.append"
186+
class="el-table__append-gutter"
187+
:style="{ height: layout.appendHeight + 'px' }"></div>
186188
</div>
187189
<div
188190
v-if="showSummary"

packages/theme-chalk/src/table.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@
8181
width: 20px;
8282
}
8383

84+
@include e(append-wrapper) {
85+
// 避免外边距重合 https://developer.mozilla.org/zh-CN/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing
86+
overflow: hidden;
87+
}
88+
8489
@include m(fit) {
8590
border-right: 0;
8691
border-bottom: 0;

0 commit comments

Comments
 (0)