storybook/docs/snippets/vue/button-story-click-handler-simple-docs.3.js.mdx
2021-11-04 23:51:08 +00:00

25 lines
515 B
Plaintext

```js
// Button.stories.js
import Button from './Button.vue';
export default {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/vue/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
};
export const Text = ({ label }) => ({
components: { Button },
setup() {
return {
label,
onClick: action('clicked'),
};
},
template: '<Button :label="label" @click="onClick" />',
});
```