Skip to content

Commit

Permalink
fix: #516 add dt-pagination-totalCount class (#517)
Browse files Browse the repository at this point in the history
  • Loading branch information
kongshan-zhuyu committed May 31, 2023
1 parent 6430567 commit 2eacc49
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 11 deletions.
6 changes: 5 additions & 1 deletion components/pagination/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ title:

最多显示 5 页内容,当数量多时默认显示前 5 页。

- 为分页器总条数添加类名 `dt-pagination-totalCount`,高亮显示

## en-US

The basic example.
Expand All @@ -19,7 +21,9 @@ import { Pagination } from 'antd';

ReactDOM.render(
<Pagination
showTotal={total => `共条40数据,每页5条`}
showTotal={total => <span>
<span className="dt-pagination-totalCount">{total}</span>条数据,每页5
</span>}
defaultCurrent={1}
pageSize={5}
total={40} />,
Expand Down
4 changes: 3 additions & 1 deletion components/pagination/demo/full.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ ReactDOM.render(
total={85}
showSizeChanger
showQuickJumper
showTotal={total => `共条${total}数据`}
showTotal={total => <span>
<span className="dt-pagination-totalCount">{total}</span>条数据
</span>}
/>,
mountNode,
);
Expand Down
5 changes: 4 additions & 1 deletion components/pagination/demo/size.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ title:

- 为分页器添加类名 `dt-pagination-right` ,使得分页器居右


```jsx
import React from 'react';
import { Pagination } from 'antd';
Expand All @@ -19,7 +20,9 @@ ReactDOM.render(
total={40}
pageSize={5}
defaultCurrent={1}
showTotal={total => `共条40数据,每页5条`}
showTotal={total => <span>
<span className="dt-pagination-totalCount">{total}</span>条数据,每页5
</span>}
/>,
mountNode,
);
Expand Down
1 change: 1 addition & 0 deletions components/pagination/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ cols: 1
|类名 |说明 |使用示例 |
|---------|---------|---------|
|.dt-pagination-right | 让分页器居右 | 居右 |
|.dt-pagination-totalCount | 高亮总条数 | 基础分页 |
2 changes: 1 addition & 1 deletion components/table/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class App extends React.Component {
size: 'small',
total: 30,
showTotal: (total) => <span>
<span style={{ color: '#3F87FF' }}>{total}</span>条数据,每页显示15
<span className="dt-pagination-totalCount">{total}</span>条数据,每页显示15
</span>
};
return (
Expand Down
2 changes: 1 addition & 1 deletion components/table/demo/expand.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ expandedRowRender = () => {
size: 'small',
total: 30,
showTotal: (total) => <span>
<span style={{ color: '#3F87FF' }}>{total}</span>条数据,每页显示15
<span className="dt-pagination-totalCount">{total}</span>条数据,每页显示15
</span>
}

Expand Down
2 changes: 1 addition & 1 deletion components/table/demo/fixBase.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class App extends React.Component {
size: 'small',
total: isShowData ? 30 : 0,
showTotal: (total) => <span>
<span style={{ color: '#3F87FF' }}>{total}</span>条数据,每页显示15
<span className="dt-pagination-totalCount">{total}</span>条数据,每页显示15
</span>
};
return (
Expand Down
2 changes: 1 addition & 1 deletion components/table/demo/fixFooter.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class App extends React.Component {
size: 'small',
total: isShowData ? 30 : 0,
showTotal: (total) => <span>
<span style={{ color: '#3F87FF' }}>{total}</span>条数据,每页显示15
<span className="dt-pagination-totalCount">{total}</span>条数据,每页显示15
</span>
};
return (
Expand Down
2 changes: 1 addition & 1 deletion components/table/demo/numberRight.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ tableFooter = () => (
total={30}
style={{ float: 'right' }}
showTotal={(total) => <span>
<span style={{ color: '#3F87FF' }}>{total}</span>条数据,每页显示20
<span className="dt-pagination-totalCount">{total}</span>条数据,每页显示20
</span>}
/>
</Col>
Expand Down
2 changes: 1 addition & 1 deletion components/table/demo/scroll.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const pagination = {
size: 'small',
total: 80,
showTotal: (total) => <span>
<span style={{ color: '#3F87FF' }}>{total}</span>条数据,每页显示15
<span className="dt-pagination-totalCount">{total}</span>条数据,每页显示15
</span>
}

Expand Down
2 changes: 1 addition & 1 deletion components/table/demo/selectAndDeal.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ tableFooter = () => (
total={30}
style={{ float: 'right' }}
showTotal={(total) => <span>
<span style={{ color: '#3F87FF' }}>{total}</span>条数据,每页显示20
<span className="dt-pagination-totalCount">{total}</span>条数据,每页显示20
</span>}
/>
</Col>
Expand Down
2 changes: 1 addition & 1 deletion components/transfer/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const App = () => {
size: 'small',
total: 20,
showTotal: (total) => <span>
<span style={{ color: '#3F87FF' }}>{total}</span>条数据,每页显示15
<span className="dt-pagination-totalCount">{total}</span>条数据,每页显示15
</span>
};

Expand Down
4 changes: 4 additions & 0 deletions theme/dt-theme/default/pagination.less
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,7 @@ ul.ant-pagination {
.dt-pagination-right {
justify-content: flex-end;
}

.dt-pagination-totalCount {
color: @blue;
}

0 comments on commit 2eacc49

Please sign in to comment.