52 lines
1.3 KiB
TypeScript
52 lines
1.3 KiB
TypeScript
/*
|
|
* @Author: zhaojinfeng 121016171@qq.com
|
|
* @Date: 2023-06-15 13:23:25
|
|
* @LastEditors: zhaojinfeng 121016171@qq.com
|
|
* @LastEditTime: 2023-06-20 17:49:52
|
|
* @FilePath: \tianheng-design\stories\Header.stories.ts
|
|
* @Description:
|
|
*
|
|
*/
|
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
|
|
import MyHeader from '../packages/header/index.vue'
|
|
|
|
const meta = {
|
|
/* 👇 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: '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/react/configure/story-layout
|
|
layout: 'fullscreen',
|
|
},
|
|
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/vue/writing-docs/autodocs
|
|
tags: ['autodocs'],
|
|
} satisfies Meta<typeof MyHeader>
|
|
|
|
export default meta
|
|
type Story = StoryObj<typeof meta>
|
|
|
|
export const LoggedIn: Story = {
|
|
args: {
|
|
user: {
|
|
name: 'Jane Doe',
|
|
},
|
|
},
|
|
}
|
|
|
|
export const LoggedOut: Story = {
|
|
args: {
|
|
user: null,
|
|
},
|
|
}
|