Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
wisdom-components
Commits
74204612
Commit
74204612
authored
May 17, 2021
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 表格增加默认show
parent
3a8ab052
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
index.js
packages/base-components/BasicTable/src/index.js
+15
-1
index.less
packages/base-components/BasicTable/src/index.less
+12
-0
No files found.
packages/base-components/BasicTable/src/index.js
View file @
74204612
...
...
@@ -7,7 +7,21 @@ import './index.less';
const
BasicTable
=
(
props
)
=>
{
const
{
getPrefixCls
}
=
useContext
(
ConfigProvider
.
ConfigContext
);
const
prefixCls
=
getPrefixCls
(
'basic-table'
);
return
<
Table
className
=
{
classNames
(
prefixCls
)}
scroll
=
{{
y
:
'calc(100% - 40px)'
}}
{...
props
}
/>
;
const
pagination
=
props
.
pagination
||
{};
const
showTotal
=
(
total
)
=>
{
debugger
;
return
`共
${
Math
.
ceil
(
total
/
(
props
.
pagination
?
props
.
pagination
.
pageSize
||
10
:
10
),
)}
页 / 共
${
total
}
条记录`
;
};
return
(
<
Table
className
=
{
classNames
(
prefixCls
)}
scroll
=
{{
y
:
'calc(100% - 40px)'
}}
{...
props
}
pagination
=
{{
showTotal
,
...
pagination
}}
/
>
);
};
BasicTable
.
defaultProps
=
{
...
...
packages/base-components/BasicTable/src/index.less
View file @
74204612
...
...
@@ -138,4 +138,16 @@
border-top: 1px solid #dbe7fb;
}
}
.ant-pagination {
display: flex;
flex-wrap: wrap;
grid-row-gap: 8px;
justify-content: flex-end;
.ant-pagination-total-text {
margin-right: auto;
margin-left: 8px;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment