about summary refs log tree commit diff
path: root/components/Posts/PostList/parentMixin.js
diff options
context:
space:
mode:
Diffstat (limited to 'components/Posts/PostList/parentMixin.js')
-rw-r--r--components/Posts/PostList/parentMixin.js9
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
 }