alkhatibdev/inertia-pagination 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

alkhatibdev/inertia-pagination

最新稳定版本:0.0.1

Composer 安装命令:

composer require alkhatibdev/inertia-pagination

包简介

Laravel Inertia Pagination, is a Laravel package for generating inertia pagination vue component, designed with TailwindCSS.

README 文档

README

Latest Version MIT Licensed

Introduction

Laravel Inertia Pagination, is a Laravel package for generating inertia pagination vue component, designed with TailwindCSS.

Installation

install via composer

composer require alkhatibdev/inertia-pagination

Publish

php artisan vendor:publish --tag=inertia-pagination

Usage

Assume this is your inertia response:

// App\Http\Controllers\PostController

public function index() 
{
    return Inertia::render('Post/Index', [
        'posts' => Post::select([
            "id", "title", "description"
        ])->paginate(10),
    ]);
}

Within your inertia page, just import IPagination vue component, then pass your paginated collection links to it.

// resources/js/Pages/Post/Index.vue 

<script setup>
    import IPagination from '@/Components/vendor/InertiaPagination/IPagination.vue'

    defineProps({
        posts: Object
    })
</script>

<template>
    ...
        <div v-for="post in posts.data" :key="post.id">...</div>

        <!-- Use component here, and pass the links array -->
        <IPagination :links="posts.links" />
    
    ...
</template>

Customization

Coming soon..

License

Language Switcher is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 147
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-11-30