fbredius/storybook

View on GitHub
docs/snippets/vue/page-story-slots.3.js.mdx

Summary

Maintainability
Test Coverage
```js
// Page.stories.js

import Page from './Page.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: 'Page',
  component: Page,
};

const Template = (args) => ({
  components: { Page },
  setup() {
    return { args };
  },
  template: `
    <page v-bind="args">
      <template v-slot:footer>
        <footer v-if="args.footer" v-html="args.footer" />
      </template>
    </page>
  `,
});

export const CustomFooter = Template.bind({});
CustomFooter.args = {
  footer: '<a href="https://storybook.js.org/">Built with Storybook</a>',
};
```