mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 03:11:49 +08:00
28 lines
439 B
Plaintext
28 lines
439 B
Plaintext
```js
|
|
// Button.stories.js
|
|
|
|
import Button from './Button.vue';
|
|
|
|
import { action } from '@storybook/addon-actions';
|
|
|
|
export default {
|
|
component: Button,
|
|
};
|
|
|
|
export const Text = {
|
|
args: {
|
|
label: 'Hello',
|
|
},
|
|
render: (args) => ({
|
|
components: { Button },
|
|
setup() {
|
|
return {
|
|
...args,
|
|
onClick: action('clicked'),
|
|
};
|
|
},
|
|
template: '<Button @onClick="onClick" :label="label" />',
|
|
}),
|
|
};
|
|
```
|