Last active
July 7, 2023 10:22
-
-
Save johanvanhelden/59abcf104c03d07e08d34eb11fd51511 to your computer and use it in GitHub Desktop.
Storybook 7.0.26 issue with custom args
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
import type { Meta, StoryObj } from '@storybook/vue3'; | |
import Component from './ReproComponent.vue'; | |
const meta: Meta<typeof Component> = { | |
component: Component, | |
render: (args, { argTypes }) => ({ | |
components: { Component }, | |
props: Object.keys(argTypes), | |
template: ` | |
<Component v-bind="$props"> | |
Card content | |
<template #footer v-if="withFooter"> | |
Footer for the card | |
</template> | |
</Component> | |
`, | |
}), | |
args: { | |
withFooter: true, | |
}, | |
}; | |
export default meta; | |
type Story = StoryObj<typeof Component>; | |
export const Default: Story = {}; |
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
<template> | |
<div> | |
<slot /> | |
<h3 v-if="$slots.footer"> | |
<slot name="footer"></slot> | |
</h3> | |
</div> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment