Laravel - 自定义 CSS 和 Bootstrap

问题描述 投票:0回答:1

我有一个刀片文件,其中有一个表,该表从执行存储过程的控制器获取值。 当我使用时,问题出在我的刀片文件上

<!-- Pagination Links -->
   <div class="text-center mt-4">
       {{ $results->links() }}
   </div> 

它还需要 laravel 分页和引导程序,这破坏了我的 UI,我该如何纠正这个问题?

laravel bootstrap-4 html-table
1个回答
0
投票

记下 Laravel 的版本以及您正在使用的 CSS。

默认的分页主题是tailwind,所以要使用bootstrap需要在AppServiceProvider中配置。

// app/Providers/AppServiceProvider.php

use Illuminate\Pagination\Paginator;
 
/**
 * Bootstrap any application services.
 */
public function boot(): void
{
    // bootstrap5
    Paginator::useBootstrapFive();

}

根据您使用的CSS选择一个。

    // bootstrap4
    Paginator::useBootstrapFour();
    // useBootstrap() is same as bootstrap4
    Paginator::useBootstrap();
    // bootstrap3
    Paginator::useBootstrapThree();

https://laravel.com/docs/11.x/pagination#customizing-the-pagination-view

© www.soinside.com 2019 - 2024. All rights reserved.