list.js 753 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import Vue from 'vue'
  2. import {isEmpty} from 'lodash'
  3. Vue.mixin({
  4. components: {
  5. },
  6. data() {
  7. return {
  8. refresher: false,
  9. tableList: [],
  10. page: 1,
  11. pageSize: 10,
  12. total: 0,
  13. loadStatus: 'nomore', //loading nomore loadmore
  14. }
  15. },
  16. methods: {
  17. //查询
  18. handleQuery() {
  19. this.page = 1
  20. this.tableList = []
  21. this.handleTableList();
  22. },
  23. // 获取列表
  24. async handleTableList() {
  25. },
  26. // 下拉刷新
  27. handleRefresher() {
  28. if (this.refresher) return;
  29. this.refresher = true;
  30. this.page = 1
  31. this.tableList = []
  32. this.handleTableList();
  33. },
  34. // 滚动到底部
  35. handleScrollLower() {
  36. if (this.page * this.pageSize < this.total) {
  37. this.page += 1;
  38. this.handleTableList();
  39. }
  40. },
  41. }
  42. })