-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add basic storybook vue js and ts template
- Loading branch information
Showing
2 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import type { ArgTypes, Meta, StoryFn } from '@storybook/vue3' | ||
|
||
import { toRefs } from 'vue' | ||
|
||
import ResourceName from 'resourcePath' | ||
|
||
type Props = InstanceType<typeof ResourceName> | ||
|
||
const argTypes: Partial<ArgTypes<Props>> = { | ||
// Describe your args type (component properties) here to autodocs show properly informations | ||
} | ||
|
||
const meta: Meta<Props> = { | ||
component: ResourceName, | ||
title: 'Components/UI/Card', | ||
tags: ['autodocs'], | ||
argTypes | ||
} | ||
|
||
export default meta | ||
|
||
const Template: StoryFn<Props> = (args) => ({ | ||
components: { ResourceName }, | ||
setup() { | ||
const reactiveArgs = toRefs(args) | ||
|
||
return { args: reactiveArgs } | ||
}, | ||
template: ` | ||
<ResourceName | ||
// pass here yours props, e.g: (remove this comment) | ||
:id="args.id" | ||
> | ||
<!-- If your component receive slots, pass them here, if not, remove this comment --> | ||
</ResourceName> | ||
` | ||
}) | ||
|
||
export const Default = Template.bind({}) | ||
Default.args = { | ||
id: 'clingon-generated-resource' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import type { ArgTypes, Meta, StoryFn } from '@storybook/vue3' | ||
|
||
import { toRefs } from 'vue' | ||
|
||
import ResourceName from 'resourcePath' | ||
|
||
const argTypes = { | ||
// Describe your args type (component properties) here to autodocs show properly informations | ||
} | ||
|
||
const meta = { | ||
component: ResourceName, | ||
title: 'Components/UI/Card', | ||
tags: ['autodocs'], | ||
argTypes | ||
} | ||
|
||
export default meta | ||
|
||
const Template = (args) => ({ | ||
components: { ResourceName }, | ||
setup() { | ||
const reactiveArgs = toRefs(args) | ||
|
||
return { args: reactiveArgs } | ||
}, | ||
template: ` | ||
<ResourceName | ||
// pass here yours props, e.g: (remove this comment) | ||
:id="args.id" | ||
> | ||
<!-- If your component receive slots, pass them here, if not, remove this comment --> | ||
</ResourceName> | ||
` | ||
}) | ||
|
||
export const Default = Template.bind({}) | ||
Default.args = { | ||
id: 'clingon-generated-resource' | ||
} |