Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
feat(index): add a prop to toggle auto search on load
Browse files Browse the repository at this point in the history
users can now turn off the initial query to Algolia on page rendering.
this feature is especially helpful for users doing SSR that do not want to generate
a call to Algolia because hydration has already be done in the backend.

Closes: #261
  • Loading branch information
rayrutjes committed Aug 8, 2017
1 parent cda198c commit 3c85017
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export default {
type: Boolean,
default: true,
},
autoSearch: {
type: Boolean,
default: true,
}
},
data() {
return {
Expand Down Expand Up @@ -97,6 +101,9 @@ export default {
},
mounted() {
this._localSearchStore.start();
if (this.autoSearch) {
this._localSearchStore.refresh();
}
},
watch: {
indexName() {
Expand Down

0 comments on commit 3c85017

Please sign in to comment.