diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2021-01-10 12:31:02 +0100 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2021-01-10 12:31:02 +0100 |
commit | ed9e80f161f6c99228595bc9dab9897469de224c (patch) | |
tree | 8b1bf8ffdce5f5d8e4f7f2d8ac49269dd3d4672a /components/Posts/PostList/parentMixin.js | |
parent | ebb089825a57c1fee04f8b2c0ea43447c07deeb6 (diff) | |
download | puszcza-ed9e80f161f6c99228595bc9dab9897469de224c.tar.gz puszcza-ed9e80f161f6c99228595bc9dab9897469de224c.zip |
Add pagination
Diffstat (limited to 'components/Posts/PostList/parentMixin.js')
-rw-r--r-- | components/Posts/PostList/parentMixin.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/components/Posts/PostList/parentMixin.js b/components/Posts/PostList/parentMixin.js index 801d51c..b9181e8 100644 --- a/components/Posts/PostList/parentMixin.js +++ b/components/Posts/PostList/parentMixin.js @@ -1,9 +1,10 @@ import { getPosts } from './index' export default { - async asyncData() { - return { - posts: await getPosts(), - } + async asyncData({ query }) { + let page = query.page || 1; + const data = await getPosts(page); + return data; }, + watchQuery: true } |