storybook/docs/snippets/vue/my-component-story-basic-and-props.js.mdx
2022-07-07 18:50:21 +01:00

28 lines
592 B
Plaintext

```js
// MyComponent.stories.js
import MyComponent from './MyComponent.vue';
export default {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/7.0/vue/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Path/To/MyComponent',
component: MyComponent,
};
export const Basic = {
render: () => ({
components: { MyComponent },
template: '<MyComponent />',
}),
};
export const WithProp = {
render: () => ({
components: { MyComponent },
template: '<MyComponent prop="value"/>',
}),
};
```