storybook/docs/snippets/vue/mdx-canvas-multiple-stories.mdx-2.mdx.mdx
2021-12-05 01:49:50 +08:00

42 lines
748 B
Plaintext

```md
<!-- Badge.stories.mdx -->
import { Canvas, Meta, Story } from '@storybook/addon-docs';
import Badge from './Badge.vue';
<Meta title="MDX/Badge" component={Badge} />
export const Template = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { Badge },
template: '<Badge v-bind="$props" />',
});
<Canvas>
<Story
name="warning"
args={{
status: 'warning',
label: 'Warning',
}}>
{Template.bind({})}
</Story>
<Story
name="neutral"
args={{
status: 'neutral',
label: 'Neutral',
}}>
{Template.bind({})}
</Story>
<Story
name="error"
args={{
status: 'error',
label: 'Error',
}}>
{Template.bind({})}
</Story>
</Canvas>
```