diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-01-25 18:54:05 +0100 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-01-25 18:54:05 +0100 |
commit | 18b44a3aebc56d32060e1d879a8f096eafbf262f (patch) | |
tree | 19c53a43fe9aa48f7716ccb5cc65e39c0f62f1ef /components/Posts/PostList | |
parent | 1b74216fc4afa740991dcc9986eb6843c5b07a59 (diff) | |
download | puszcza-18b44a3aebc56d32060e1d879a8f096eafbf262f.tar.gz puszcza-18b44a3aebc56d32060e1d879a8f096eafbf262f.zip |
Add image to PostLink
Diffstat (limited to 'components/Posts/PostList')
-rw-r--r-- | components/Posts/PostList/PurePostList.stories.js | 15 | ||||
-rw-r--r-- | components/Posts/PostList/PurePostList.vue | 9 |
2 files changed, 16 insertions, 8 deletions
diff --git a/components/Posts/PostList/PurePostList.stories.js b/components/Posts/PostList/PurePostList.stories.js index e2c39de..0df4ce3 100644 --- a/components/Posts/PostList/PurePostList.stories.js +++ b/components/Posts/PostList/PurePostList.stories.js @@ -4,27 +4,34 @@ import { postLink } from '../PostLink.stories' import PurePostList from './PurePostList' -export const posts = Array(5).fill(postLink) +const postLinkNoImage = { ...postLink } +delete postLinkNoImage['image'] +console.log(postLinkNoImage) + +export const posts = [ + ...Array(3).fill(postLinkNoImage), + ...Array(5).fill(postLink), +] storiesOf('Posts/PurePostList', module) .add('default', () => { return { components: { PurePostList }, template: `<pure-post-list :posts="posts"/>`, - data: () => ({ posts }) + data: () => ({ posts }), } }) .add('loading', () => { return { components: { PurePostList }, template: `<pure-post-list :posts="posts" loading/>`, - data: () => ({ posts: [] }) + data: () => ({ posts: [] }), } }) .add('no posts', () => { return { components: { PurePostList }, template: `<pure-post-list :posts="posts"/>`, - data: () => ({ posts: [] }) + data: () => ({ posts: [] }), } }) diff --git a/components/Posts/PostList/PurePostList.vue b/components/Posts/PostList/PurePostList.vue index ace069f..c87b9dc 100644 --- a/components/Posts/PostList/PurePostList.vue +++ b/components/Posts/PostList/PurePostList.vue @@ -12,6 +12,7 @@ :route="post.route" :title="post.title" :description="post.description" + :image="post.image" /> </div> </transition> @@ -27,14 +28,14 @@ export default { props: { posts: { type: Array, - required: true + required: true, }, loading: { type: Boolean, required: false, - default: () => false - } - } + default: () => false, + }, + }, } </script> |