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

46 lines
845 B
Plaintext

```js
// Button.stories.js
import Button from './Button.vue';
export default {
component: Button,
};
export const Primary = {
args: {
backgroundColor: '#ff0',
label: 'Button',
},
render: (args, { argTypes }) => ({
components: { Button },
props: Object.keys(argTypes),
template: '<Button v-bind="$props" />',
}),
};
export const Secondary = {
args: {
...Primary.args,
label: '😄👍😍💯',
},
render: (args, { argTypes }) => ({
components: { Button },
props: Object.keys(argTypes),
template: '<Button v-bind="$props" />',
}),
};
export const Tertiary = {
args: {
...Primary.args,
label: '📚📕📈🤓',
},
render: (args, { argTypes }) => ({
components: { Button },
props: Object.keys(argTypes),
template: '<Button v-bind="$props" />',
}),
};
```