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
|
import { storiesOf } from '@storybook/vue'
import { postLink } from '../PostLink.stories'
import PurePostList from './PurePostList'
const postLinkNoImage = JSON.parse(JSON.stringify(postLink))
delete postLinkNoImage.meta['image']
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 }),
}
})
.add('loading', () => {
return {
components: { PurePostList },
template: `<pure-post-list :posts="posts" loading/>`,
data: () => ({ posts: [] }),
}
})
.add('no posts', () => {
return {
components: { PurePostList },
template: `<pure-post-list :posts="posts"/>`,
data: () => ({ posts: [] }),
}
})
|