forked from algolia/vue-instantsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSnippet.stories.js
43 lines (40 loc) · 1.14 KB
/
Snippet.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
41
42
43
import { storiesOf } from '@storybook/vue';
import { previewWrapper } from './utils';
storiesOf('ais-snippet', module)
.addDecorator(previewWrapper())
.add('default', () => ({
template: `
<div>
<ais-configure
:attributesToSnippet="['name', 'description']"
snippetEllipsisText="[…]"
/>
<ais-hits>
<div slot="item" slot-scope="{ item }">
<h2><ais-snippet attribute="name" :hit="item"></ais-snippet></h2>
<small>
<ais-snippet attribute="description" :hit="item"></ais-snippet>
</small>
</div>
</ais-hits>
</div>
`,
}))
.add('with highlighted tag name', () => ({
template: `
<div>
<ais-configure
:attributesToSnippet="['name', 'description']"
snippetEllipsisText="[…]"
/>
<ais-hits>
<div slot="item" slot-scope="{ item }">
<h2><ais-snippet attribute="name" :hit="item"></ais-snippet></h2>
<small>
<ais-snippet attribute="description" :hit="item" highlighted-tag-name="span"></ais-snippet>
</small>
</div>
</ais-hits>
</div>
`,
}));