Tailwind laravel 分页无法正常工作

Thi*_*elo 3 laravel tailwind-css

因此,我正在使用 laravel 和 tailwind 创建一个项目。使用 paginate() 方法后,然后在视图中使用此代码

@if ($posts->count())
                @foreach ($posts as $post)
                    <div class="mb-4">
                        <a class="font-bold" href="">{{ $post->user->name }}</a> <span
                            class="text-gray-600 text-sm">{{ $post->created_at->diffForHumans() }}</span>

                        <p class="mb-2">{{ $post->description }}</p>
                    </div>

                @endforeach
                {{ $posts->links() }} (this line to create the link to other pages is not working properly)
            @else
                <p>There are no posts</p>
            @endif 
Run Code Online (Sandbox Code Playgroud)

分页设计有点奇怪。转到下一页和上一页可以正常工作。 网站

小智 5

我有同样的问题。无法修复它,但找到了解决方法:

php artisan vendor:publish --tag=laravel-pagination
Run Code Online (Sandbox Code Playgroud)

如此处所述: https://laravel.com/docs/8.x/pagination#customizing-the-pagination-view

输出的 resources/views/vendor/pagination/tailwind.blade.php 文件确实具有正确的 css 并且看起来不错。