亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

我的 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 關注
  • 133 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號