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

Commit

Permalink
feat(search-store): make query reactive in search store component
Browse files Browse the repository at this point in the history
  • Loading branch information
rayrutjes committed Mar 16, 2017
1 parent d632b0a commit e666ff3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/vue-algolia-search-store/src/SearchStore.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,21 @@
return
}
},
query: {
type: String,
default: ""
}
},
provide () {
this._localSearchStore = createFromAlgoliaCredentials(this.appId, this.apiKey)
if (this.index) {
this._localSearchStore.index = this.index
}
if(this.query) {
this._localSearchStore.query = this.query
}
// Todo: add user agent
return {
Expand All @@ -61,6 +69,9 @@
watch: {
index () {
this._localSearchStore.index = this.index
},
query () {
this._localSearchStore.query = this.query
}
}
}
Expand Down

0 comments on commit e666ff3

Please sign in to comment.