fix: update list `pagination` props type
parent
6a0f93486e
commit
7b5fb53dfe
|
@ -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>
|
||||
`;
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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
|
||||
})
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue