UNPKG

@storybook/cli

Version:

Storybook's CLI - easiest method of adding storybook to your projects

47 lines (40 loc) 1.17 kB
import MyButton from './Button.vue'; // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export export default { title: 'Example/Button', component: MyButton, // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes argTypes: { backgroundColor: { control: 'color' }, size: { control: { type: 'select' }, options: ['small', 'medium', 'large'], }, }, }; // More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args const Template = (args, { argTypes }) => ({ props: Object.keys(argTypes), components: { MyButton }, template: '<my-button @onClick="onClick" v-bind="$props" />', }); export const Primary = Template.bind({}); // More on args: https://storybook.js.org/docs/vue/writing-stories/args Primary.args = { primary: true, label: 'Button', }; export const Secondary = Template.bind({}); Secondary.args = { label: 'Button', }; export const Large = Template.bind({}); Large.args = { size: 'large', label: 'Button', }; export const Small = Template.bind({}); Small.args = { size: 'small', label: 'Button', };