question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pagination in Inertiajs

See original GitHub issue

Versions:

  • @inertiajs/inertia version: “^0.8.4”
  • @inertiajs/inertia-vue3 version: “^0.3.5”

Describe the problem:

This is my Vue Component Code for pagination

<inertia-link  v-if="$page.props.categories.meta.links[index].url"
                    :href="$page.props.categories.meta.links[index].url"
                    :headers="{ page: index }"
                    as="button" type="button">
              <span class="rounded-2 p-2 text-white mx-2"
                  :class="[ $page.props.categories.meta.links[index].active ? 'bg-dark cursor-default' : 'bg-red-600' ]"
                  v-html='$page.props.categories.meta.links[index].label'>
              </span>
</inertia-link>

This code for index in Laravel 8

public function index()
    {
        $categories = CategoriesResources::Collection(Categories::paginate(10));
        return Inertia::render('Categories/Index', ['categories' => $categories]);
    }

The problem is when I want to change the page its only change one page like from page[1] to page[3] and then I can’t change any more and that’s need Reloading the page

in inertia-linl tag I send to it Array of links how can I modify the URL link in the page without reload the page

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
reininkcommented, Jun 10, 2021

When you access this app in your browser, what’s the URL? Is it different than http://localhost:8000? If yes, that’s the issue. You’ll need to look into how to properly set the app URL. I don’t think this is an Inertia issue.

0reactions
reininkcommented, Jun 11, 2021

Glad you got it figured out. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Laravel + Inertia + Vuejs: Pagination - Stack Overflow
Creator of Inertia.js here.. So, you can totally use the Laravel paginator with Inertia, you just need to setup your page components to ......
Read more >
Pagination - Build Modern Laravel Apps Using Inertia.js
You'll be happy to hear that Laravel makes a pagination laughably simple to implement. In this episode, we'll add a list of pagination...
Read more >
Laravel 9 Vue Inertia Pagination Integration Tutorial
How to Integrate Inertia Js Pagination in Laravel 9 ; Step 1: Create Laravel App ; Step 2: Connect to Database ; Step...
Read more >
Laravel Inertia JS Pagination Example - ItSolutionStuff.com
Hi,. This article is focused on laravel inertia js pagination example. you'll learn laravel inertia js pagination. if you want to see ...
Read more >
Inertia Js Paginate - gists · GitHub
Inertia Js Paginate. GitHub Gist: instantly share code, notes, and snippets.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found