storybook/docs/snippets/vue/button-story-with-args.2.js.mdx
2021-08-28 01:52:57 +01:00

24 lines
470 B
Plaintext

```js
// Button.stories.js
import Button from './Button.vue';
export default {
component: Button,
};
export const Primary = {
args: {
primary: true,
label: 'Button',
},
render: (args, { argTypes }) => ({
components: { Button },
props: Object.keys(argTypes),
// Storybook provides all the args in a $props variable.
// Each arg is also available as their own name.
template: '<Button v-bind="$props" v-on="$props" />',
}),
};
```