Skip to content

Commit c32c8d4

Browse files
committed
fix: showSizeChanger无效 #148
1 parent 2f939dc commit c32c8d4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/components/Table/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default {
5959
default: false
6060
},
6161
showPagination: {
62-
type: String,
62+
type: String | Boolean,
6363
default: 'auto'
6464
}
6565
}),
@@ -119,9 +119,9 @@ export default {
119119
this.localLoading = true
120120
const parameter = Object.assign({
121121
pageNo: (pagination && pagination.current) ||
122-
this.localPagination.current,
122+
this.localPagination.current || this.pageNum,
123123
pageSize: (pagination && pagination.pageSize) ||
124-
this.localPagination.pageSize
124+
this.localPagination.pageSize || this.pageSize
125125
},
126126
(sorter && sorter.field && {
127127
sortField: sorter.field
@@ -153,7 +153,8 @@ export default {
153153

154154
// 这里用于判断接口是否有返回 r.totalCount 或 this.showPagination = false
155155
// 当情况满足时,表示数据不满足分页大小,关闭 table 分页功能
156-
!r.totalCount && ['auto', false].includes(this.showPagination) && (this.localPagination = false)
156+
157+
(!this.showPagination || !r.totalCount && this.showPagination === 'auto') && (this.localPagination = false)
157158
this.localDataSource = r.data // 返回结果中的数组数据
158159
this.localLoading = false
159160
})

0 commit comments

Comments
 (0)