mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 07:41:58 +08:00
41 lines
918 B
Plaintext
41 lines
918 B
Plaintext
```ts
|
|
// Button.stories.ts
|
|
|
|
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
|
|
import Button from './Button.vue';
|
|
|
|
const meta: Meta<typeof Button> = {
|
|
component: Button,
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof Button>;
|
|
|
|
/*
|
|
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
|
|
* See https://storybook.js.org/docs/api/csf
|
|
* to learn how to use render functions.
|
|
*/
|
|
export const Primary: Story = {
|
|
render: () => ({
|
|
components: { Button },
|
|
template: '<Button background="#ff0" label="Button" />',
|
|
}),
|
|
};
|
|
|
|
export const Secondary: Story = {
|
|
render: () => ({
|
|
components: { Button },
|
|
template: '<Button background="#ff0" label="😄👍😍💯" />',
|
|
}),
|
|
};
|
|
|
|
export const Tertiary: Story = {
|
|
render: () => ({
|
|
components: { Button },
|
|
template: '<Button background="#ff0" label="📚📕📈🤓" />',
|
|
}),
|
|
};
|
|
```
|