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
7faa69b2
Commit
7faa69b2
authored
May 24, 2021
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改表格
parent
a716279b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
+17
-4
Basic.tsx
packages/base-components/BasicTable/src/demos/Basic.tsx
+8
-1
Summary.tsx
packages/base-components/BasicTable/src/demos/Summary.tsx
+7
-1
index.js
packages/base-components/BasicTable/src/index.js
+2
-2
No files found.
packages/base-components/BasicTable/src/demos/Basic.tsx
View file @
7faa69b2
...
...
@@ -46,7 +46,14 @@ const Demo = () => {
// @ts-ignore
return
(
<
div
style=
{
{
height
:
'800px'
}
}
>
{
!!
dataSource
.
length
&&
<
BasicTable
dataSource=
{
dataSource
}
columns=
{
columns
}
bordered
/>
}
{
!!
dataSource
.
length
&&
(
<
BasicTable
dataSource=
{
dataSource
}
columns=
{
columns
}
bordered
pagination=
{
{
current
:
1
,
pageSize
:
20
,
size
:
'default'
}
}
/>
)
}
{
!
dataSource
.
length
&&
<
Empty
description=
{
'暂无数据'
}
/>
}
</
div
>
);
...
...
packages/base-components/BasicTable/src/demos/Summary.tsx
View file @
7faa69b2
...
...
@@ -67,7 +67,13 @@ const Demo = () => {
return
(
<
div
style=
{
{
height
:
'400px'
}
}
>
{
!!
dataSource
.
length
&&
(
<
BasicTable
dataSource=
{
dataSource
}
columns=
{
columns
}
bordered
summary=
{
Summary
}
/>
<
BasicTable
dataSource=
{
dataSource
}
columns=
{
columns
}
bordered
summary=
{
Summary
}
pagination=
{
false
}
/>
)
}
{
!
dataSource
.
length
&&
<
Empty
description=
{
'暂无数据'
}
/>
}
</
div
>
...
...
packages/base-components/BasicTable/src/index.js
View file @
7faa69b2
...
...
@@ -7,7 +7,7 @@ import './index.less';
const
BasicTable
=
(
props
)
=>
{
const
{
getPrefixCls
}
=
useContext
(
ConfigProvider
.
ConfigContext
);
const
prefixCls
=
getPrefixCls
(
'basic-table'
);
const
pagination
=
props
.
pagination
||
{};
const
pagination
=
typeof
props
.
pagination
!==
'undefined'
?
props
.
pagination
:
{};
const
showTotal
=
(
total
)
=>
{
debugger
;
return
`共
${
Math
.
ceil
(
...
...
@@ -19,7 +19,7 @@ const BasicTable = (props) => {
className
=
{
classNames
(
prefixCls
)}
scroll
=
{{
y
:
'calc(100% - 40px)'
}}
{...
props
}
pagination
=
{
{
showTotal
,
...
pagination
}
}
pagination
=
{
pagination
?
{
showTotal
,
...
pagination
}
:
pagination
}
/
>
);
};
...
...
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