pagination.uvue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 class="!text-sm">{{ t("上一页") }}</cl-text>
  37. </template>
  38. <template #next>
  39. <cl-text class="!text-sm">{{ t("下一页") }}</cl-text>
  40. </template>
  41. </cl-pagination>
  42. </demo-item>
  43. </view>
  44. </cl-page>
  45. </template>
  46. <script lang="ts" setup>
  47. import { ref } from "vue";
  48. import { t } from "@/locale";
  49. import DemoItem from "../components/item.uvue";
  50. const page1 = ref(1);
  51. const page2 = ref(13);
  52. const page3 = ref(1);
  53. const page4 = ref(1);
  54. </script>