How to pass props to component's story?
I've solved it.
.add('with labeled custom options as props', () => ({ components: {VSelect}, data() { return { options: [{value: "CA", label: "Canada"}, {value: "UK", label: "United Kingdom"}] } }, template: `<v-select :options="options" />` }))
There were 2 problems with my former approach:
- Passed
data
was not wrapped in a function - I should have pass
data
only. Using bothprops
anddata
seems to make Vue return a warning (The data property "options" is already declared as a prop.) and ignore passeddata
(even though it's just a warning not an error, which I find odd)