🐛(table): 修复 scroll 在固定列时不固定的问题

This commit is contained in:
就眠儀式
2022-07-21 09:59:57 +08:00
parent 35118feb60
commit 826dc0fa75
4 changed files with 9 additions and 6 deletions

View File

@@ -285,7 +285,7 @@ const renderFixedStyle = (column: any, columnIndex: number) => {
}
return { left: `${left}px` } as StyleValue;
} else {
var right = 0;
var right = scrollWidthCell.value > 0 ? scrollWidthCell.value : 0;
for (var i = columnIndex + 1; i < props.columns.length; i++) {
if (props.columns[i].fixed && props.columns[i].fixed == "right") {
right = right + props.columns[i]?.width.replace("px", "");
@@ -472,9 +472,12 @@ const renderTotalRowCell = (column: any) => {
</template>
<th
v-if="scrollWidthCell > 0"
class="layui-table-fixed-right"
:style="{
padding: 0,
width: `${scrollWidthCell}px`,
background: '#fafafa'
}"
></th>
</tr>