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

feat(widget:toggle-refinement): allow multiple values for "on" and "off" #780

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions src/components/ToggleRefinement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ export default {
required: true,
},
on: {
type: [String, Number, Boolean],
type: [String, Number, Boolean, Array],
required: false,
default: true,
},
off: {
type: [String, Number, Boolean],
type: [String, Number, Boolean, Array],
required: false,
// explicit otherwise Vue coerces the default value
// to false because of the `Boolean` prop type
Expand Down
9 changes: 9 additions & 0 deletions stories/ToggleRefinement.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ storiesOf('ais-toggle-refinement', module)
/>
`,
}))
.add('with an on value (with multiple values)', () => ({
template: `
<ais-toggle-refinement
attribute="brand"
label="Brands starting with \"i\""
Kocal marked this conversation as resolved.
Show resolved Hide resolved
:on="['Samsung', 'Metra']"
/>
`,
}))
.add('with an off value', () => ({
template: `
<ais-toggle-refinement
Expand Down