Skip to content

Commit

Permalink
feat(ais-toggle-refinement): allow multiple values for "on" and "off" (
Browse files Browse the repository at this point in the history
…algolia/vue-instantsearch#780)

* feat(widget:toggle-refinement): allow multiples values for "on" and "off"

* chore: add story

* Update stories/ToggleRefinement.stories.js

Co-authored-by: Haroen Viaene <fingebimus@me.com>

Co-authored-by: Haroen Viaene <fingebimus@me.com>
  • Loading branch information
Kocal and Haroenv authored Jun 18, 2020
1 parent 9b120fc commit 4a7b570
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
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
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="Metra or Samsung"
:on="['Samsung', 'Metra']"
/>
`,
}))
.add('with an off value', () => ({
template: `
<ais-toggle-refinement
Expand Down

0 comments on commit 4a7b570

Please sign in to comment.