Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bundlesize.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
{
"path": "packages/vue-instantsearch/vue2/cjs/index.js",
"maxSize": "20.25 kB"
"maxSize": "20.50 kB"
},
{
"path": "packages/vue-instantsearch/vue3/cjs/index.js",
Expand Down
14 changes: 13 additions & 1 deletion packages/vue-instantsearch/src/components/InstantSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ export default createInstantSearchComponent({
},
indexName: {
type: String,
required: true,
required: false,
},
compositionID: {
type: String,
required: false,
},
routing: {
default: undefined,
Expand Down Expand Up @@ -101,6 +105,7 @@ export default createInstantSearchComponent({
insightsClient: this.insightsClient,
insights: this.insights,
indexName: this.indexName,
compositionID: this.compositionID,
routing: this.routing,
stalledSearchDelay: this.stalledSearchDelay,
searchFunction: this.searchFunction,
Expand All @@ -111,6 +116,13 @@ export default createInstantSearchComponent({
};
},
render: renderCompat(function (h) {
if (!this.indexName && !this.compositionID) {
// eslint-disable-next-line no-console
console.error(
'Missing either "index-name" or "compositionID" property on "ais-instant-search"'
);
}

return h(
'div',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ export const createInstantSearchComponent = (component) =>
indexName(indexName) {
this.instantSearchInstance.helper.setIndex(indexName || '').search();
},
compositionID(compositionID) {
this.instantSearchInstance.helper
.setIndex(compositionID || '')
.search();
},
stalledSearchDelay(stalledSearchDelay) {
// private InstantSearch.js API:
this.instantSearchInstance._stalledSearchDelay = stalledSearchDelay;
Expand Down