about summary refs log tree commit diff
path: root/components/Posts/PostList/README.md
blob: 839f9c21a0a11e300faf0588e59e9fe5d72e6ec9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
## PostList

This component creates a list of posts

### Usage

```html
<template>
  <post-list :posts="posts">
</template>

<script>
import PostList, { getPosts } from '~/components/Posts/PostList';

export default {
  components: { PostList },
  async asyncData() {
    return {
      posts: await getPosts()
    }
  }
}
</script>
```

Or by using the mixin

```html
<template>
  <post-list :posts="posts">
</template>

<script>
import PostList from '~/components/Posts/PostList';
import postListParentMixin from '~/components/Posts/PostList/parentMixin';

export default {
  components: { PostList },
  mixins: [postListParentMixin]
}
</script>
```