Skip to content

Commit

Permalink
fix(Transfer): 修复设置pageSizeOptions时切换pageSize无法生效得问题
Browse files Browse the repository at this point in the history
  • Loading branch information
morningbao committed Oct 28, 2024
1 parent cadfdaa commit dfc38b4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/transfer/components/transfer-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ export default mixins(keepAnimationMixins, classPrefixMixins).extend({
return {
filterValue: '', // 搜索框输入内容,
// 用于兼容处理 Pagination 的非受控属性(非受控属性仅有 change 事件变化,无 props 变化,因此只需监听事件)
defaultCurrent: 1,
defaultCurrent: null,
// 用于兼容处理 Pagination 的非受控属性
defaultPageSize: 0,
defaultPageSize: null,
// 支持targetList 排序
draggingIndex: null,
dragoverIndex: null,
Expand All @@ -102,10 +102,10 @@ export default mixins(keepAnimationMixins, classPrefixMixins).extend({
// this.defaultCurrent 属于分页组件抛出的事件参数,非受控的情况也会有该事件触发
// this.pagination.defaultCurrent 为表格组件传入的非受控属性
currentPage(): number {
return this.pagination?.current ?? this.defaultCurrent ?? this.pagination?.defaultCurrent;
return this.pagination?.current ?? this.defaultCurrent ?? this.pagination?.defaultCurrent ?? 1;
},
pageSize(): number {
return this.pagination?.pageSize ?? this.defaultPageSize ?? this.pagination?.defaultPageSize;
return this.pagination?.pageSize ?? this.defaultPageSize ?? this.pagination?.defaultPageSize ?? 10;
},
pageTotal(): number {
return (this.filteredData && this.filteredData.length) || 0;
Expand Down

0 comments on commit dfc38b4

Please sign in to comment.