amir-hossein5/laravel-components

laravel-components

v2.0.2 2021-12-08 10:16 UTC

This package is auto-updated.

Last update: 2024-09-23 18:19:37 UTC


README

此包提供使用 tailwindcss 内置的现成分页组件(你不需要安装它)。

例如,代替

//Controller
 $users = User::paginate(4);
//Blade
{{ $users->links() }}

你可以在 blade 中使用

<x-pagination::gray-circled :elems="$users" />

并且它以 gray-circled 主题预览

gray-circled-theme

但你可以 更改 主题 和更多 设置,阅读 使用说明


先决条件

  • Laravel 8
  • PHP 8

安装

composer require amir-hossein5/laravel-components

组件

分页

指令

<x-pagination::theme-name :elems="$users" 

样式

...
    @lComponentStyles('pagination')
</head>

分页标签的所有参数

例如

<x-pagination::light-underlined
  :elems="$users"
  :showPaginatorDetails="false"
  :showDisabledButtons="true" 
/>

主题

分页

  • light

    light-theme
  • gray

    gray-theme gray-theme
  • light-circled

    light-circled-theme
  • gray-circled

    gray-circled-theme
  • light-underlined

    light-underlined-theme
  • red-pill

    red-pill-theme

修改

要修改任何组件,请使用 vendor:publish --tag=componentName-themeName
例如,对于 分页gray 主题

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

许可证

许可证