Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
najiu-frontend
najiu-admin-template
Commits
e3278937
Commit
e3278937
authored
Jul 27, 2021
by
无木
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(table): fix `pagination` props working
修复table的pagination属性无法动态设置数据的问题
parent
c375e323
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
usePagination.tsx
src/components/Table/src/hooks/usePagination.tsx
+11
-1
No files found.
CHANGELOG.zh_CN.md
View file @
e3278937
...
...
@@ -11,6 +11,7 @@
-
**BasicTable**
-
修复全屏模式下看不到子组件弹出层(popconfirm 以及 select、treeSelect 等编辑组件)的问题
-
修复启用
`expandRowByClick`
时,点击不可展开的行可能会导致样式错误的问题
-
修复
`pagination`
属性动态改变不生效的问题
-
**Dark Theme**
黑暗主题下的配色问题修正
-
修复
`Tree`
组件被选中节点的背景颜色
-
修复
`Alert`
组件的颜色配置
...
...
src/components/Table/src/hooks/usePagination.tsx
View file @
e3278937
import
type
{
PaginationProps
}
from
'
../types/pagination
'
;
import
type
{
BasicTableProps
}
from
'
../types/table
'
;
import
{
computed
,
unref
,
ref
,
ComputedRef
}
from
'
vue
'
;
import
{
computed
,
unref
,
ref
,
ComputedRef
,
watchEffect
}
from
'
vue
'
;
import
{
LeftOutlined
,
RightOutlined
}
from
'
@ant-design/icons-vue
'
;
import
{
isBoolean
}
from
'
/@/utils/is
'
;
import
{
PAGE_SIZE
,
PAGE_SIZE_OPTIONS
}
from
'
../const
'
;
...
...
@@ -27,6 +27,16 @@ export function usePagination(refProps: ComputedRef<BasicTableProps>) {
const
configRef
=
ref
<
PaginationProps
>
({});
const
show
=
ref
(
true
);
watchEffect
(()
=>
{
const
{
pagination
}
=
unref
(
refProps
);
if
(
!
isBoolean
(
pagination
)
&&
pagination
)
{
configRef
.
value
=
{
...
unref
(
configRef
),
...(
pagination
??
{}),
};
}
});
const
getPaginationInfo
=
computed
(():
PaginationProps
|
boolean
=>
{
const
{
pagination
}
=
unref
(
refProps
);
...
...
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