forked from algolia/vue-instantsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRatingMenu.stories.js
40 lines (39 loc) · 1.07 KB
/
RatingMenu.stories.js
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
import { storiesOf } from '@storybook/vue';
import { previewWrapper } from './utils';
storiesOf('ais-rating-menu', module)
.addDecorator(
previewWrapper({
indexName: 'instant_search_rating_asc',
})
)
.add('default', () => ({
template: `
<ais-rating-menu attribute="rating" />
`,
}))
.add('custom rendering', () => ({
template: `
<div>
<ais-rating-menu attribute="rating">
<template slot-scope="{ items, refine }">
rating
<ul>
<li v-for="(item, key) in items" :key="key">
<button @click="refine(item.value)">
{{item.isRefined ? '🙅♀️' : '✔️'}} {{item.name}} & up
</button>
</li>
</ul>
</template>
</ais-rating-menu>
</div>`,
}))
.add('with a Panel', () => ({
template: `
<ais-panel>
<template slot="header">Rating Menu</template>
<ais-rating-menu attribute="rating" />
<template slot="footer">Footer</template>
</ais-panel>
`,
}));