How to pass props to component's story? How to pass props to component's story? vue.js vue.js

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 both props and data seems to make Vue return a warning (The data property "options" is already declared as a prop.) and ignore passed data (even though it's just a warning not an error, which I find odd)