mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 07:01:53 +08:00
29 lines
522 B
Plaintext
29 lines
522 B
Plaintext
```ts
|
|
// Button.stories.ts
|
|
|
|
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
|
|
import Button from './Button.vue';
|
|
|
|
import { action } from '@storybook/addon-actions';
|
|
|
|
const meta: Meta<typeof Button> = {
|
|
component: Button,
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof Button>;
|
|
|
|
export const Text: Story = {
|
|
render: () => ({
|
|
components: { Button },
|
|
setup() {
|
|
return {
|
|
onClick: action('clicked'),
|
|
};
|
|
},
|
|
template: '<Button label="Hello" @click="onClick" />',
|
|
}),
|
|
};
|
|
```
|