diff options
Diffstat (limited to 'components/Posts/PostList/README.md')
-rw-r--r-- | components/Posts/PostList/README.md | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/components/Posts/PostList/README.md b/components/Posts/PostList/README.md new file mode 100644 index 0000000..839f9c2 --- /dev/null +++ b/components/Posts/PostList/README.md @@ -0,0 +1,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> +``` |