tableCommon.js 658 B

12345678910111213141516171819202122232425262728293031323334
  1. export default {
  2. data() {
  3. return {
  4. pagination: {
  5. page: 1,
  6. pageSize: 30,
  7. total: 0,
  8. },
  9. selectedRows: [],
  10. pageSizes: [10, 20, 30, 50, 100],
  11. headerStyle: {
  12. background: '#fafafa',
  13. },
  14. }
  15. },
  16. computed: {
  17. tableHeight() {
  18. return this.$baseTableHeight(-47)
  19. },
  20. },
  21. methods: {
  22. selectionChange(selection) {
  23. this.selectedRows = selection
  24. },
  25. handleSizeChange(size) {
  26. this.pagination.pageSize = size
  27. this.search()
  28. },
  29. handleCurrentChange(currentPage) {
  30. this.pagination.page = currentPage
  31. this.search('pageChange')
  32. },
  33. },
  34. }