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
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
其他信息
- 授权协议: MIT
- 更新时间: 2023-11-30