pagination.uvue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <cl-page>
  3. <view class="p-3">
  4. <demo-item :label="t('基础用法')">
  5. <cl-pagination v-model="page1" :total="24"> </cl-pagination>
  6. </demo-item>
  7. <demo-item :label="t('多页数')">
  8. <cl-pagination v-model="page2" :total="500"> </cl-pagination>
  9. </demo-item>
  10. <demo-item :label="t('自定义样式')">
  11. <cl-pagination
  12. v-model="page3"
  13. :total="100"
  14. :pt="{
  15. item: {
  16. className: '!rounded-none !mx-[2rpx]'
  17. }
  18. }"
  19. >
  20. </cl-pagination>
  21. </demo-item>
  22. <demo-item :label="t('自定义文本')">
  23. <cl-pagination
  24. v-model="page4"
  25. :total="24"
  26. :pt="{
  27. prev: {
  28. className: '!w-auto px-3'
  29. },
  30. next: {
  31. className: '!w-auto px-3'
  32. }
  33. }"
  34. >
  35. <template #prev>
  36. <cl-text
  37. :pt="{
  38. className: '!text-sm'
  39. }"
  40. >{{ t("上一页") }}</cl-text
  41. >
  42. </template>
  43. <template #next>
  44. <cl-text
  45. :pt="{
  46. className: '!text-sm'
  47. }"
  48. >{{ t("下一页") }}</cl-text
  49. >
  50. </template>
  51. </cl-pagination>
  52. </demo-item>
  53. </view>
  54. </cl-page>
  55. </template>
  56. <script lang="ts" setup>
  57. import { ref } from "vue";
  58. import { t } from "@/locale";
  59. import DemoItem from "../components/item.uvue";
  60. const page1 = ref(1);
  61. const page2 = ref(13);
  62. const page3 = ref(1);
  63. const page4 = ref(1);
  64. </script>