mirror of
https://github.com/KwiTsukasa/kt-template-admin.git
synced 2026-05-27 16:35:47 +08:00
perf: 优化KtTable横向滚动性能
This commit is contained in:
parent
84b0b995d2
commit
dcb32e6037
@ -179,6 +179,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&__ant {
|
&__ant {
|
||||||
|
.ant-table,
|
||||||
|
.ant-table-container,
|
||||||
|
.ant-table-content,
|
||||||
|
.ant-table-header,
|
||||||
|
.ant-table-body {
|
||||||
|
overscroll-behavior: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-table table {
|
||||||
|
table-layout: fixed !important;
|
||||||
|
}
|
||||||
|
|
||||||
.ant-spin-container,
|
.ant-spin-container,
|
||||||
.ant-table {
|
.ant-table {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -198,6 +210,7 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
z-index: 5;
|
z-index: 5;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
|
contain: paint;
|
||||||
background: hsl(var(--card));
|
background: hsl(var(--card));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,7 +219,10 @@
|
|||||||
z-index: 1;
|
z-index: 1;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
max-height: var(--kt-table-scroll-y) !important;
|
max-height: var(--kt-table-scroll-y) !important;
|
||||||
|
contain: paint;
|
||||||
overflow: auto !important;
|
overflow: auto !important;
|
||||||
|
scrollbar-gutter: stable;
|
||||||
|
will-change: scroll-position;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-table-summary {
|
.ant-table-summary {
|
||||||
@ -247,6 +263,14 @@
|
|||||||
background: hsl(var(--card)) !important;
|
background: hsl(var(--card)) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 固定列阴影会在横向滚动时随 Antdv shadow class 反复重绘,KT 表格用边框区分固定列即可。
|
||||||
|
.ant-table-cell-fix-start-shadow::after,
|
||||||
|
.ant-table-cell-fix-end-shadow::after,
|
||||||
|
.ant-table-cell-fix-left-last::after,
|
||||||
|
.ant-table-cell-fix-right-first::after {
|
||||||
|
box-shadow: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
.ant-table-thead > tr > th {
|
.ant-table-thead > tr > th {
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user