pagination

Pagination with go-to-page input

Pagination with go-to-page input

Загрузка превью…

src/pagination/c-pagination-5.vue

<!--
  Расхождение с апстримом: `IconPlaceholder` заменена инлайновым `<svg>`
  (lucide-react v0.545.0 "chevron-left"/"chevron-right") — см. docs/PORTING.md §5.
-->
<script setup lang="ts">
import { Input } from "@/components/ui/input"
import { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink } from "@/components/ui/pagination"
</script>

<template>
  <Pagination class="w-full max-w-xs">
    <PaginationContent class="justify-between gap-4">
      <PaginationItem class="flex items-center gap-1">
        <PaginationLink href="#" size="icon" aria-label="Go to previous page">
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="lucide lucide-chevron-left size-4">
            <path d="m15 18-6-6 6-6" />
          </svg>
        </PaginationLink>
        <PaginationLink href="#" :is-active="true">1</PaginationLink>
        <PaginationLink href="#">2</PaginationLink>
        <PaginationLink href="#">3</PaginationLink>
        <PaginationEllipsis />
        <PaginationLink href="#" size="icon" aria-label="Go to next page">
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="lucide lucide-chevron-right size-4">
            <path d="m9 18 6-6-6-6" />
          </svg>
        </PaginationLink>
      </PaginationItem>
      <PaginationItem class="flex items-center gap-2">
        <span class="text-muted-foreground text-sm whitespace-nowrap">Go to page</span>
        <Input type="number" min="1" max="10" :value="1" class="h-9 w-14 text-center" />
      </PaginationItem>
    </PaginationContent>
  </Pagination>
</template>

Установка

npx shadcn-vue@latest add https://revueui.rootapi.dev/r/c-pagination-5.json

Зависимости реестра

Источник: порт из ReUI (Keenthemes, MIT)