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

Commit 6834766

Browse files
committed
fix(RefinementList): pass createURL to item
IFW-209
1 parent ae275be commit 6834766

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docs/src/components/RefinementList.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,18 @@ class-names | Object | `{}` | Override class names | no
3737

3838
Name | Scope | Description
3939
---|---|---
40-
default | `{ items: Array, refine: Function, searchable: Boolean, searchForItems: Function, isFromSearch: Boolean, toggleShowMore: Function, isShowingMore: Boolean, createURL: Function, canRefine: Boolean, noRefinement: Boolean }` | Slot to override the DOM output
41-
item | `{ value: String, label: String, count: Number, isRefined: Boolean, highlighted }` | Slot to override the DOM of a single item in the list
40+
default | `{ items: Array<Item>, refine: (Item.value) => void, searchable: Boolean, searchForItems: Function, isFromSearch: Boolean, toggleShowMore: Function, isShowingMore: Boolean, createURL: Function, canRefine: Boolean, noRefinement: Boolean }` | Slot to override the DOM output
41+
item | `{ item: Item, refine: (Item.value) => void, createURL: (Item) => String }` | Slot to override the DOM of a single item in the list
4242
showMoreLabel | `{ isShowingMore: Boolean }` | Slot to override the text shown in the "show more" button
4343
noResults | `{ query: String }` | Slot to override the text shown when "searchable" is true and there are no results
4444

45+
With `Item` being an object containing:
46+
47+
* label (String): string form of the value
48+
* count (Number): number of hits that would be shown if this item is applied
49+
* isRefined (Boolean): is the value applied already
50+
* value (String): value to give to `refine`
51+
4552
Note that if you override the default or item slot, and you still want highlighting when `searchable` is enabled, you should use [ais-highlight](./highlight) to have this feature:
4653

4754
```html

src/components/RefinementList.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
name="item"
4141
:item="item"
4242
:refine="refine"
43+
:createURL="state.createURL"
4344
>
4445
<label :class="suit('label')">
4546
<input

0 commit comments

Comments
 (0)