mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 03:11:49 +08:00
24 lines
503 B
Plaintext
24 lines
503 B
Plaintext
```js
|
|
// YourComponent.stories.js
|
|
|
|
import { YourComponent } from './YourComponent';
|
|
|
|
// This default export determines where your story goes in the story list
|
|
export default {
|
|
title: 'YourComponent',
|
|
component: YourComponent,
|
|
};
|
|
|
|
const Template = (args) => ({
|
|
components: { YourComponent },
|
|
props: { args },
|
|
template: '<YourComponent v-bind="$props"/>',
|
|
});
|
|
|
|
export const FirstStory = Template.bind({});
|
|
|
|
FirstStory.args = {
|
|
/* the args you need here will depend on your component */
|
|
};
|
|
```
|