🚀
Launch Stack
Website
  • Welcome
  • Get Started
  • Stack
  • Updates
  • 📡Backend
    • Introduction
    • Application Structure
    • Config
    • API
    • Authentication
      • Email and Password
      • Social Login
    • Debugging
    • Environment Variables
    • File Uploads
    • Logging
    • Mail
    • Handling Errors [Sentry]
    • Notifications
      • Email Notifications
      • In-App Notifications
    • Payments [Stripe]
    • Payments [Paddle]
    • Routing
    • Testing
      • Feature Tests
      • Browser Tests
  • 🛡️Frontend
    • Introduction
    • Routing
    • Tailwind and SCSS
    • Views
    • Layouts
    • Components
      • Command Palette
      • Feedback
      • Form
      • Modal
      • Pagination
    • i18n
  • 🖥️App
    • Account
    • API
    • Billing
    • Team Members
    • Team Settings
  • ⚙️Admin
    • Introduction
    • Team Management
    • User Management
    • Notifications
    • Feedback
    • Blog Management
Powered by GitBook
On this page

Was this helpful?

  1. Frontend
  2. Components

Pagination

LaunchStack provides a default pagination component, 100% compatible with Laravel, Vue, and Inertiajs.

How to use

class BlogController extends Controller
{
    public function home()
    {
        return Inertia::render('Blog/Home', [
            'posts' => BlogPost::published()->latest()->paginate(12)
        ]);
    }
}
# resources/js/Components/Pagination.vue

<script setup>
import Pagination from "@/Components/Pagination.vue";
const { posts } = defineProps({
    posts: Object,
});
</script>
<template>
    <div v-for="post in posts" :key="post">
        {{ post.title }}
    </div>

    <Pagination :data="posts" />
</template>

The component was two different styles:

  • list [default value]

  • table

You can directly pass props to the component:

<Pagination :data="posts" style="table" />
PreviousModalNexti18n

Last updated 2 years ago

Was this helpful?

🛡️