Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ctrlaltdelme's avatar

Infinite Scrolling

I'm trying to implement infinite scroll per Jeffrey's video and I don't have it quite right. I am paginating my Tag model and returning some other metadata to the page.

I'm defining some interfaces and the props like so:

interface Tag {
    id: number;
    name: string;
    slug: string;
    color: string;
    description?: string;
    posts_count: number;
}

interface Pagination {
    current_page: number;
    last_page: number;
    has_more_pages: boolean;
    per_page: number;
    total: number;
}

const props = defineProps<{
    tags: Tag[];
    pagination: Pagination;
    totalTags?: number;
    totalPosts?: number;
}>();

And I'm trying to perform infinite scrolling like this

When I scroll to the buffer, I can see the Loading spinner and text, and in the Vue dev tools, I can 100% see that the tags Array is being appended to, but the actual Card items I have in the divs aren't rendering the other Tag models.

What am I missing?

1 like
3 replies
ctrlaltdelme's avatar

@vincent15000 Hello! Sorry I did forget to include it. It's in the Vue View :D. In fact, here's the rest of the setup script.

ctrlaltdelme's avatar

I can get it to work, somewhat after making some changes. Changing from allTags to tags works, but loses search/filter capability (never updates the card display). Or, I can set it to filteredTags which will have search work, but loses the pagination/infinite scroll functionality. I'm not sure how to get both :D

Please or to participate in this conversation.