Skip to content
This repository was archived by the owner on May 27, 2019. It is now read-only.

Commit d86d14b

Browse files
committed
feat(ssr): add facet registration to example
1 parent 7e97ddf commit d86d14b

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

examples/ssr/src/Search.vue

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
<template>
2-
<ais-index :searchStore="searchStore">
2+
<ais-index :searchStore="searchStore" :auto-search="false">
3+
34
<ais-search-box placeholder="Find products"/>
4-
<ul>
5+
6+
<ais-refinement-list attribute-name="colors"></ais-refinement-list>
7+
58
<ais-results>
69
<template scope="{ result }">
7-
<li>
10+
<div>
811
<ais-highlight :result="result" attribute-name="name"></ais-highlight>
9-
</li>
12+
</div>
1013
</template>
1114
</ais-results>
12-
</ul>
15+
1316
</ais-index>
1417
</template>
1518
<script>
1619
import {
1720
createFromAlgoliaCredentials,
1821
createFromSerialized,
22+
FACET_OR,
1923
} from 'vue-instantsearch';
2024
2125
let store;
@@ -30,9 +34,11 @@ export default {
3034
3135
store.indexName = 'ikea';
3236
store.query = route.params.query ? route.params.query : '';
37+
store.addFacet('colors', FACET_OR);
3338
store.highlightPreTag = '<mark>';
3439
store.highlightPostTag = '</mark>';
3540
store.start();
41+
store.refresh();
3642
3743
return store.waitUntilInSync().then(() => {
3844
context.state = {
@@ -61,9 +67,6 @@ export default {
6167
}
6268
},
6369
},
64-
mounted() {
65-
// this.searchStore.start();
66-
},
6770
data() {
6871
return {
6972
searchStore: store,

0 commit comments

Comments
 (0)