Skip to content

Commit

Permalink
fix: 修复由于 box-sizing 不一致而导致 fixed 层高度偏差的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin-front committed Jul 8, 2019
1 parent 256bbc9 commit a34fcea
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/css/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@
background-color: #fff;
border-bottom: 1px solid #dddee1;
position: relative;

&-wrap{
position: relative;
border: 1px solid #dddee1;
// border-bottom: none;
display: flex;
align-content: stretch;

& *{
box-sizing: border-box;
}
}
&-big{
.@{fb}{
Expand Down
6 changes: 3 additions & 3 deletions src/tableFoot.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<template>
<div class="flex-table-foot">
<div class="flex-table-row" :style="{ height: height }">
<div class="flex-table-foot" :style="{ height: height }">
<div class="flex-table-row">
<div
class="flex-table-col"
v-for="(item, index) in columns"
Expand Down Expand Up @@ -70,7 +70,7 @@ export default {
if (!this.onlyFixed) {
this.owner.onRowHeightChange({
rowIndex: 'footer',
height: this.$el.offsetHeight-1,
height: this.$el.offsetHeight,
});
}
},
Expand Down
6 changes: 3 additions & 3 deletions src/tableHead.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="flex-table-head">
<div class="flex-table-row" :style="{ height: height }">
<div class="flex-table-head" :style="{ height: height }">
<div class="flex-table-row">
<div
class="flex-table-col"
v-for="(item, index) in headRow"
Expand Down Expand Up @@ -129,7 +129,7 @@ export default {
if (!this.onlyFixed) {
this.owner.onRowHeightChange({
rowIndex: 'header',
height: this.$el.offsetHeight-1,
height: this.$el.offsetHeight,
});
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/tableTr.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default {
if (!this.onlyFixed) {
this.owner.onRowHeightChange({
rowIndex: this.rowIndex,
height: this.$el.offsetHeight-1,
height: this.$el.offsetHeight,
})
}
}
Expand Down

0 comments on commit a34fcea

Please sign in to comment.