Commit c32c8d4c by saraka

fix: showSizeChanger无效 #148

parent 2f939dcb
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
default: false default: false
}, },
showPagination: { showPagination: {
type: String, type: String | Boolean,
default: 'auto' default: 'auto'
} }
}), }),
...@@ -119,9 +119,9 @@ export default { ...@@ -119,9 +119,9 @@ export default {
this.localLoading = true this.localLoading = true
const parameter = Object.assign({ const parameter = Object.assign({
pageNo: (pagination && pagination.current) || pageNo: (pagination && pagination.current) ||
this.localPagination.current, this.localPagination.current || this.pageNum,
pageSize: (pagination && pagination.pageSize) || pageSize: (pagination && pagination.pageSize) ||
this.localPagination.pageSize this.localPagination.pageSize || this.pageSize
}, },
(sorter && sorter.field && { (sorter && sorter.field && {
sortField: sorter.field sortField: sorter.field
...@@ -153,7 +153,8 @@ export default { ...@@ -153,7 +153,8 @@ export default {
// 这里用于判断接口是否有返回 r.totalCount 或 this.showPagination = false // 这里用于判断接口是否有返回 r.totalCount 或 this.showPagination = false
// 当情况满足时,表示数据不满足分页大小,关闭 table 分页功能 // 当情况满足时,表示数据不满足分页大小,关闭 table 分页功能
!r.totalCount && ['auto', false].includes(this.showPagination) && (this.localPagination = false)
(!this.showPagination || !r.totalCount && this.showPagination === 'auto') && (this.localPagination = false)
this.localDataSource = r.data // 返回结果中的数组数据 this.localDataSource = r.data // 返回结果中的数组数据
this.localLoading = false this.localLoading = false
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment