由于分页,无法看到下拉菜单中的所有选项

时间:2018-11-16 00:31:21

标签: javascript laravel vue.js vuejs2 laravel-5.7

我正在使用Laravel 5.7VueJs 2.5.* ...

我为发票和供应商表进行了分页。我有一个创建发票表格,其中有用于选择供应商的下拉选项,我有20多个供应商,在进行分页之后,我在表格中看到我的下拉选项中只有10个供应商...我不知道如何解决此问题。

分页是这样的:

在HTML中

<!--PAGINATION FOR VENDORS TABLE -->
<pagination :data="ticketInvoices" @pagination-change-page="getResults"></pagination>

<!--PAGINATION FOR VENDORS TABLE -->
<pagination :data="vendors" @pagination-change-page="getResults"></pagination>

methods:{}的两个分页

//METHOD FOR INVOICE
getResults(page = 1) {
  axios.get("api/ticket-invoice?page=" + page).then(response => {
    this.ticketInvoices = response.data;
  });
},

//METHOD FOR VENDOR
getResults(page = 1) {
  axios.get("api/vendor?page=" + page).then(response => {
    this.vendors = response.data;
  });
},

InvoiceControllerVendorController

/*Invoice Controller*/
class TicketInvoiceController extends Controller
{
    public function index()
    {
        $ticketInvoices = TicketInvoice::orderBy('created_at', 'desc')->paginate(10);
        return $ticketInvoices;
    }

/*Invoice Controller*/
class VendorController extends Controller
{
    public function index()
    {
        $vendor = Vendor::paginate(10);
        return $vendor;
    }

分页之前 enter image description here

分页后 enter image description here

0 个答案:

没有答案