Struggling with incorporating stories into the vue-select component using Storybook, especially in more complex cases involving passing props or methods.
When attempting to pass props within the template it functions correctly:
storiesOf('VSelect', module)
.add('with labeled custom options', () => ({
components: {VSelect},
template: `<v-select :options='[{value: "CA", label: "Canada"}, {value: "UK", label: "United Kingdom"}]' />`
}))
However, I find this method less readable and prefer to pass them as separate props or data:
.add('with labeled custom options as props', () => ({
components: {VSelect},
props: {options: [{value: "CA", label: "Canada"}, {value: "UK", label: "United Kingdom"}]},
data: {options: [{value: "CA", label: "Canada"}, {value: "UK", label: "United Kingdom"}]},
template: `<v-select />`
}))
Unfortunately, neither data
, nor props
are recognized by Storybook - they appear to be disregarded.