fix: update list `pagination` props type

pull/398/head
tangjinzhou 2019-01-05 10:53:40 +08:00
parent 6a0f93486e
commit 7b5fb53dfe
4 changed files with 18 additions and 7 deletions

View File

@ -1,3 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`List renders empty list 1`] = `<div class="ant-list ant-list-split"><span tag="div" class="ant-spin-nested-loading"><div class="ant-spin-container"><div class="ant-list-empty-text">No data</div></div></span></div>`;
exports[`List renders empty list 1`] = `
<div class="ant-list ant-list-split">
<div class="ant-spin-nested-loading">
<div class="ant-spin-container">
<div class="ant-list-empty-text">No data</div>
</div>
</div>
</div>
`;

View File

@ -46,12 +46,12 @@ export default {
}
},
beforeMount () {
this.getData((res) => {
this.fetchData((res) => {
this.data = res.results
})
},
methods: {
getData (callback) {
fetchData (callback) {
reqwest({
url: fakeDataUrl,
type: 'json',

View File

@ -48,12 +48,12 @@ export default {
}
},
beforeMount () {
this.getData((res) => {
this.fetchData((res) => {
this.data = res.results.map((item, index) => ({ ...item, index }))
})
},
methods: {
getData (callback) {
fetchData (callback) {
reqwest({
url: fakeDataUrl,
type: 'json',
@ -73,7 +73,7 @@ export default {
this.loading = false
return
}
this.getData((res) => {
this.fetchData((res) => {
this.data = data.concat(res.results).map((item, index) => ({ ...item, index }))
this.loading = false
})

View File

@ -39,7 +39,10 @@ export const ListProps = () => ({
itemLayout: PropTypes.string,
loading: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
loadMore: PropTypes.any,
pagination: PaginationConfig(),
pagination: PropTypes.oneOfType([
PropTypes.shape(PaginationConfig()).loose,
PropTypes.bool,
]),
prefixCls: PropTypes.string,
rowKey: PropTypes.any,
renderItem: PropTypes.any,