| | |
| | | <template> |
| | | <div> |
| | | <div class="fade"> |
| | | <div v-infinite-scroll="loadMore" infinite-scroll-disabled="busy" :infinite-scroll-distance="10"> |
| | | <div class="mySecret" v-if="data.length==0"> |
| | | <p>空空如也..</p> |
| | |
| | | </div> |
| | | |
| | | |
| | | <div v-if="loading && !busy" class="demo-loading-container"> |
| | | <div v-if="loading && !busy" class="loading-container"> |
| | | <a-spin /> |
| | | </div> |
| | | </div> |
| | |
| | | } |
| | | }, |
| | | typeId: function(newValue, oldValue) { |
| | | this.busy = true; |
| | | |
| | | //有条件不刷新 |
| | | if (newValue == undefined && oldValue != "") { |
| | | return |
| | | } |
| | | |
| | | // if (newValue == undefined || oldValue == "") { |
| | | // return |
| | | // } |
| | | |
| | | this.busy = true; |
| | | this.$message.info('loading', 0.3); |
| | | this.onChange(1); |
| | | }, |
| | | }, |
| | | activated() { |
| | | this.busy = false; |
| | | window.addEventListener('scroll', this); |
| | | }, |
| | | deactivated() { |
| | | this.busy = true; |
| | | window.removeEventListener('scroll', this); |
| | | }, |
| | | methods: { |
| | |
| | | }; |
| | | </script> |
| | | <style> |
| | | .demo-loading-container { |
| | | .loading-container { |
| | | position: absolute; |
| | | bottom: 40px; |
| | | width: 100%; |