props.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. import { defineProps } from '../../libs/util/props';
  2. export default defineProps('pagination', {
  3. // 当前页码
  4. // #ifdef VUE3
  5. modelValue: {
  6. type: Number,
  7. default: 1
  8. },
  9. // #endif
  10. //#ifdef VUE2
  11. value: {
  12. type: Number,
  13. default: 1
  14. },
  15. // #endif
  16. // 总记录数,用于计算总页数
  17. total: {
  18. type: Number,
  19. default: 0
  20. },
  21. // 每页显示的记录数
  22. pageSize: {
  23. type: Number,
  24. default: 3
  25. },
  26. // 显示的页码按钮数量
  27. pagerCount: {
  28. type: Number,
  29. default: 3
  30. },
  31. // 是否禁用分页
  32. disabled: {
  33. type: Boolean,
  34. default: false
  35. },
  36. // 是否显示省略号
  37. forceEllipses: {
  38. type: Boolean,
  39. default: false
  40. },
  41. // 是否为简单分页
  42. simple: {
  43. type: Boolean,
  44. default: false
  45. },
  46. // 是否展示上一页按钮
  47. showPrevButton: {
  48. type: Boolean,
  49. default: true
  50. },
  51. // 是否展示下一页按钮
  52. showNextButton: {
  53. type: Boolean,
  54. default: true
  55. },
  56. // 上一页按钮文字
  57. prevText: {
  58. type: String,
  59. default: () => uni.$u.$t('uPagination.prevText')
  60. },
  61. // 下一页按钮文字
  62. nextText: {
  63. type: String,
  64. default: () => uni.$u.$t('uPagination.nextText')
  65. },
  66. // 背景色
  67. bgColor: {
  68. type: [String, Boolean],
  69. default: '#f7f7f7'
  70. },
  71. // 文本色
  72. color: {
  73. type: String,
  74. default: '#606266'
  75. },
  76. // 激活背景色
  77. activeBgColor: {
  78. type: [String, Boolean],
  79. default: '#2979ff'
  80. },
  81. // 激活文本色
  82. activeColor: {
  83. type: [String, Boolean],
  84. default: '#ffffff'
  85. },
  86. // 字体尺寸
  87. fontSize: {
  88. type: String,
  89. default: '14px'
  90. },
  91. // 圆角
  92. round: {
  93. type: String,
  94. default: '4px'
  95. },
  96. // 描边色
  97. borderColor: {
  98. type: [String, Boolean],
  99. default: ''
  100. },
  101. // 每项宽度
  102. itemWidth: {
  103. type: String,
  104. default: '34px'
  105. },
  106. // 每项高度
  107. itemHeight: {
  108. type: String,
  109. default: '34px'
  110. }
  111. })