fix: update list `pagination` props type
parent
6a0f93486e
commit
7b5fb53dfe
|
@ -1,3 +1,11 @@
|
||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// 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>
|
||||||
|
`;
|
||||||
|
|
|
@ -46,12 +46,12 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeMount () {
|
beforeMount () {
|
||||||
this.getData((res) => {
|
this.fetchData((res) => {
|
||||||
this.data = res.results
|
this.data = res.results
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getData (callback) {
|
fetchData (callback) {
|
||||||
reqwest({
|
reqwest({
|
||||||
url: fakeDataUrl,
|
url: fakeDataUrl,
|
||||||
type: 'json',
|
type: 'json',
|
||||||
|
|
|
@ -48,12 +48,12 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeMount () {
|
beforeMount () {
|
||||||
this.getData((res) => {
|
this.fetchData((res) => {
|
||||||
this.data = res.results.map((item, index) => ({ ...item, index }))
|
this.data = res.results.map((item, index) => ({ ...item, index }))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getData (callback) {
|
fetchData (callback) {
|
||||||
reqwest({
|
reqwest({
|
||||||
url: fakeDataUrl,
|
url: fakeDataUrl,
|
||||||
type: 'json',
|
type: 'json',
|
||||||
|
@ -73,7 +73,7 @@ export default {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.getData((res) => {
|
this.fetchData((res) => {
|
||||||
this.data = data.concat(res.results).map((item, index) => ({ ...item, index }))
|
this.data = data.concat(res.results).map((item, index) => ({ ...item, index }))
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
|
|
|
@ -39,7 +39,10 @@ export const ListProps = () => ({
|
||||||
itemLayout: PropTypes.string,
|
itemLayout: PropTypes.string,
|
||||||
loading: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
|
loading: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
|
||||||
loadMore: PropTypes.any,
|
loadMore: PropTypes.any,
|
||||||
pagination: PaginationConfig(),
|
pagination: PropTypes.oneOfType([
|
||||||
|
PropTypes.shape(PaginationConfig()).loose,
|
||||||
|
PropTypes.bool,
|
||||||
|
]),
|
||||||
prefixCls: PropTypes.string,
|
prefixCls: PropTypes.string,
|
||||||
rowKey: PropTypes.any,
|
rowKey: PropTypes.any,
|
||||||
renderItem: PropTypes.any,
|
renderItem: PropTypes.any,
|
||||||
|
|
Loading…
Reference in New Issue