为了账号安全,请及时绑定邮箱和手机立即绑定

我的 laravel 应用中的分页显示两次

我的 laravel 应用中的分页显示两次

呼唤远方 2022-08-18 15:35:22
我最近向我的项目添加了可排序和删除模式。添加删除模式后,我现在将分页渲染两次。(包括图片以说明)。我的控制器    public function index()    {        $contacts = Contact::sortable('firstName')->paginate(10);        return view('contacts.index', ['contacts' => $contacts]);    }我的网络打包混合.jsconst mix = require('laravel-mix');/* |-------------------------------------------------------------------------- | Mix Asset Management |-------------------------------------------------------------------------- | | Mix provides a clean, fluent API for defining some Webpack build steps | for your Laravel application. By default, we are compiling the Sass | file for the application as well as bundling up all the JS files. | */mix.js('resources/js/app.js', 'public/js')    .sass('resources/sass/app.scss', 'public/css');mix.webpackConfig(webpack => {    return { plugins: [new webpack.ProvidePlugin({                $: "jquery",                jQuery: ["jquery", "$"],                "window.jQuery": "jquery",                Popper: ["popper.js", "default"]            })] };});我已经尝试了很多事情,但我在这个问题上有点不合时宜。一如既往,提前致谢!!!
查看完整描述

1 回答

?
沧海一幻觉

TA贡献1824条经验 获得超5个赞

为了快速查看更改一些内容。还要检查您的某些代码是否未正确注释,或者是否缺少 div。


<div class="row">   

    <div class="table-responsive">

      <table>

            //here goes your table data

      </table>

       // pagination goes here or after the next div

       {{ $contacts->links() }}

          OR

       //you can write this way either

       {{ $contacts->appends(request()->except('page'))->links() }}

    </div>

</div>


//Modals goes here...

//comment {!! $contacts->appends(\Request::except('page'))->render() !!} if it is not commented



查看完整回答
反对 回复 2022-08-18
  • 1 回答
  • 0 关注
  • 205 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号