|
|
|
@ -29,12 +29,8 @@ const withLoadMore = ({
|
|
|
|
|
return {
|
|
|
|
|
loading: false,
|
|
|
|
|
bottomedOut: false,
|
|
|
|
|
error: false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
entries () {
|
|
|
|
|
return select(this.$props, this.$store) || []
|
|
|
|
|
error: false,
|
|
|
|
|
entries: []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created () {
|
|
|
|
@ -48,6 +44,11 @@ const withLoadMore = ({
|
|
|
|
|
destroy && destroy(this.$props, this.$store)
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// Entries is not a computed because computed can't track the dynamic
|
|
|
|
|
// selector for changes and won't trigger after fetch.
|
|
|
|
|
updateEntries () {
|
|
|
|
|
this.entries = select(this.$props, this.$store) || []
|
|
|
|
|
},
|
|
|
|
|
fetchEntries () {
|
|
|
|
|
if (!this.loading) {
|
|
|
|
|
this.loading = true
|
|
|
|
@ -61,6 +62,9 @@ const withLoadMore = ({
|
|
|
|
|
this.loading = false
|
|
|
|
|
this.error = true
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
this.updateEntries()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
scrollLoad (e) {
|
|
|
|
|