-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for args #13
Comments
@tobiasdiez any update on this? I love using |
Same as @JoJk0 above ☝️ 😞 |
In this example, you are binding How is the I wonder if supporting Ultimately, instead of declaring a value on an object key, you declare a variable within the script context: <script setup lang="ts">
import BButton from "./b-button.vue";
const shortLabel = 'Click';
const longLabel = 'Click me';
</script>
<template>
<Stories title="Components/Button" :component="BButton">
<Story title="ShortLabel">
<BButton :label="shortLabel"/>
</Story>
<Story title="LongLabel">
<BButton :label="longLabel" />
</Story>
</Stories>
</template> Since you are passing the value directly to the component, you won't need the type inference since the value of I am not sure I can see an immediate benefit of However, there is definitely the need to have a |
I agree for simple templates there is little advantages over having multiple story defs. But if the story template gets more involved, you don't want to copy-paste it to every variant of the args. But probably this use case can be taken care of by #1. |
This could be closed and we could track the progress in #76 |
Proposal:
The parameter to
defineArgs
is optional and is automatically mapped toargTypes
in the default export.Ideally, we can reuse the workarounds of storybookjs/storybook#13917 to have a working source code display, that shows the current state of the component.
The text was updated successfully, but these errors were encountered: