storybook/code/renderers/vue3/template/cli/Header.stories.js
2022-11-17 16:55:37 +01:00

42 lines
1.0 KiB
JavaScript

import MyHeader from './Header.vue';
export default {
title: 'Example/Header',
component: MyHeader,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/7.0/vue/writing-docs/docs-page
tags: ['docsPage'],
render: (args) => ({
// Components used in your story `template` are defined in the `components` object
components: {
MyHeader,
},
// The story's `args` need to be mapped into the template through the `setup()` method
setup() {
// Story args can be spread into the returned object
return {
...args,
};
},
// Then, the spread values can be accessed directly in the template
template: '<my-header :user="user" />',
}),
parameters: {
// More on how to position stories at: https://storybook.js.org/docs/7.0/vue/configure/story-layout
layout: 'fullscreen',
},
};
export const LoggedIn = {
args: {
user: {
name: 'Jane Doe',
},
},
};
export const LoggedOut = {
args: {
user: null,
},
};