diff options
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 } |