mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 21:21:47 +08:00
40 lines
1013 B
TypeScript
40 lines
1013 B
TypeScript
import type { StoryObj } from '@storybook/vue3';
|
|
import MyHeader from './Header.vue';
|
|
|
|
export default {
|
|
/* 👇 The title prop is optional.
|
|
* See https://storybook.js.org/docs/7.0/vue/configure/overview#configure-story-loading
|
|
* to learn how to generate automatic titles
|
|
*/
|
|
title: 'Example/Header',
|
|
component: MyHeader,
|
|
render: (args: any) => ({
|
|
components: { MyHeader },
|
|
setup() {
|
|
return { args };
|
|
},
|
|
template: '<my-header :user="args.user" />',
|
|
}),
|
|
parameters: {
|
|
// More on how to position stories at: https://storybook.js.org/docs/7.0/react/configure/story-layout
|
|
layout: 'fullscreen',
|
|
},
|
|
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/7.0/vue/writing-docs/docs-page
|
|
tags: ['autodocs'],
|
|
};
|
|
|
|
type Story = StoryObj<typeof MyHeader>;
|
|
export const LoggedIn: Story = {
|
|
args: {
|
|
user: {
|
|
name: 'Jane Doe',
|
|
},
|
|
},
|
|
};
|
|
|
|
export const LoggedOut: Story = {
|
|
args: {
|
|
user: undefined,
|
|
},
|
|
};
|