WL-32 - Install Storybook

This commit is contained in:
2020-11-05 04:20:17 +01:00
parent 4bcfc0d518
commit 3285bc3363
22 changed files with 6648 additions and 7 deletions

39
stories/Button.stories.js Normal file
View File

@@ -0,0 +1,39 @@
import MyButton from './Button.vue';
export default {
title: 'Example/Button',
component: MyButton,
argTypes: {
backgroundColor: { control: 'color' },
size: { control: { type: 'select', options: ['small', 'medium', 'large'] } },
},
};
const Template = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { MyButton },
template: '<my-button @onClick="onClick" v-bind="$props" />',
});
export const Primary = Template.bind({});
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',
};