Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Table): 修复展开收起斑马纹样式错误 #2823

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/_common
Submodule _common updated 127 files
8 changes: 7 additions & 1 deletion src/table/TBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export default function TBody(props: TableBodyProps) {
'rowHeight',
'scrollType',
];

data?.forEach((row, rowIndex) => {
const trProps = {
...pick(props, TABLE_PROPS),
Expand All @@ -158,7 +159,12 @@ export default function TBody(props: TableBodyProps) {
}

const trNode = (
<TR key={get(row, props.rowKey || 'id') || rowIndex} {...trProps} onRowMounted={props.handleRowMounted}></TR>
<TR
key={get(row, props.rowKey || 'id') || rowIndex}
{...trProps}
onRowMounted={props.handleRowMounted}
rowClassName={[trProps.rowClassName, allTableClasses.tableBaseClass.row]}
></TR>
);
trNodeList.push(trNode);

Expand Down
40 changes: 20 additions & 20 deletions src/table/__tests__/__snapshots__/pagination.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`BaseTable Pagination > locale data pagination controlled > both pagination.pageSize and pagination.current changed 1`] = `
NodeList [
<tr
class=""
class="t-table__row__odd t-table__row"
>
<td
class="table-test-column-index"
Expand All @@ -22,7 +22,7 @@ NodeList [
</td>
</tr>,
<tr
class=""
class="t-table__row__even t-table__row"
>
<td
class="table-test-column-index"
Expand All @@ -41,7 +41,7 @@ NodeList [
</td>
</tr>,
<tr
class=""
class="t-table__row__odd t-table__row"
>
<td
class="table-test-column-index"
Expand All @@ -60,7 +60,7 @@ NodeList [
</td>
</tr>,
<tr
class=""
class="t-table__row__even t-table__row"
>
<td
class="table-test-column-index"
Expand All @@ -77,7 +77,7 @@ NodeList [
/>
</tr>,
<tr
class=""
class="t-table__row__odd t-table__row"
>
<td
class="table-test-column-index"
Expand All @@ -101,7 +101,7 @@ NodeList [
exports[`BaseTable Pagination > locale data pagination controlled > pagination.current changed 1`] = `
NodeList [
<tr
class=""
class="t-table__row__odd t-table__row"
>
<td
class="table-test-column-index"
Expand All @@ -120,7 +120,7 @@ NodeList [
</td>
</tr>,
<tr
class=""
class="t-table__row__even t-table__row"
>
<td
class="table-test-column-index"
Expand All @@ -139,7 +139,7 @@ NodeList [
</td>
</tr>,
<tr
class=""
class="t-table__row__odd t-table__row"
>
<td
class="table-test-column-index"
Expand All @@ -158,7 +158,7 @@ NodeList [
</td>
</tr>,
<tr
class=""
class="t-table__row__even t-table__row"
>
<td
class="table-test-column-index"
Expand All @@ -175,7 +175,7 @@ NodeList [
/>
</tr>,
<tr
class=""
class="t-table__row__odd t-table__row"
>
<td
class="table-test-column-index"
Expand Down Expand Up @@ -258,7 +258,7 @@ exports[`BaseTable Pagination > locale data pagination controlled > pagination.c
class="t-table__body"
>
<tr
class=""
class="t-table__row__odd t-table__row"
>
<td
class="table-test-column-index"
Expand All @@ -277,7 +277,7 @@ exports[`BaseTable Pagination > locale data pagination controlled > pagination.c
</td>
</tr>
<tr
class=""
class="t-table__row__even t-table__row"
>
<td
class="table-test-column-index"
Expand All @@ -296,7 +296,7 @@ exports[`BaseTable Pagination > locale data pagination controlled > pagination.c
</td>
</tr>
<tr
class=""
class="t-table__row__odd t-table__row"
>
<td
class="table-test-column-index"
Expand All @@ -313,7 +313,7 @@ exports[`BaseTable Pagination > locale data pagination controlled > pagination.c
/>
</tr>
<tr
class=""
class="t-table__row__even t-table__row"
>
<td
class="table-test-column-index"
Expand All @@ -332,7 +332,7 @@ exports[`BaseTable Pagination > locale data pagination controlled > pagination.c
</td>
</tr>
<tr
class=""
class="t-table__row__odd t-table__row"
>
<td
class="table-test-column-index"
Expand Down Expand Up @@ -535,7 +535,7 @@ exports[`BaseTable Pagination > locale data pagination controlled > pagination.c
exports[`BaseTable Pagination > locale data pagination controlled > pagination.pageSize changed 1`] = `
NodeList [
<tr
class=""
class="t-table__row__odd t-table__row"
>
<td
class="table-test-column-index"
Expand All @@ -554,7 +554,7 @@ NodeList [
</td>
</tr>,
<tr
class=""
class="t-table__row__even t-table__row"
>
<td
class="table-test-column-index"
Expand All @@ -573,7 +573,7 @@ NodeList [
</td>
</tr>,
<tr
class=""
class="t-table__row__odd t-table__row"
>
<td
class="table-test-column-index"
Expand All @@ -592,7 +592,7 @@ NodeList [
</td>
</tr>,
<tr
class=""
class="t-table__row__even t-table__row"
>
<td
class="table-test-column-index"
Expand All @@ -609,7 +609,7 @@ NodeList [
/>
</tr>,
<tr
class=""
class="t-table__row__odd t-table__row"
>
<td
class="table-test-column-index"
Expand Down
Loading
Loading