Skip to content
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.

Pagination #9

Closed
ribsousa opened this issue Sep 30, 2016 · 3 comments
Closed

Pagination #9

ribsousa opened this issue Sep 30, 2016 · 3 comments

Comments

@ribsousa
Copy link

Implement pagination results?

@scottbedard
Copy link
Owner

Include a page parameter in the blog api request, and add settings in the backend to determine how many posts to display on each page.

https://github.com/scottbedard/rainlab-blog-api/blob/master/controllers/PostsController.php#L55-L59

@ribsousa
Copy link
Author

ribsousa commented Oct 1, 2016

In list.vue add parameter this.$route.params

methods: {
        fetchData() {
          const posts = BlogResource.getPosts(this.$route.params)
          this.$resources({ posts })
        }
      }

In blog.js add parameter ${page}

    getPosts({ page }) {
    return Vue.http.get(`/api/rainlab/blog/${page}`)
  }
}

Not work!

@scottbedard
Copy link
Owner

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants