-
-
Notifications
You must be signed in to change notification settings - Fork 2
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 |
* chore: init * chore: remove enforce * chore: npm run * fix: nuxt options * chore: update deps * chore: fix tsup commands (#1) * fix: path, close #2 * build: use tsup.config.ts * chore: update dependencies (#5) * chore: update deps * fix: `pnpm run dev` error (#7) * fix: pnpm run dev error * style: lint fix * fix: fix dev error (#9) * chore: update deps * chore: update * fix: cjs exports (#10) (#11) * feat: add esbuild export (#12) * ci: update release script * chore: update deps * feat: add esbuild export (#14) * feat: add esbuild export (#13) * chore: lint * chore: add deps of 'chalk' (#15) Co-authored-by: Anthony Fu <[email protected]> * chore: update deps * fix: 'UserOptions' set to optional (#18) * feat: use type=module (#16) (#17) * fix: pnpm workspace config (#19) * chore: update deps * fix: nuxt module hooks (#20) * chore: update deps * chore: update deps * chore: update ci matrix * chore: update deps * chore: lint * feat: update builds * ci: add permission * docs: update (#21) * docs: update playground link (#22) * feat: template update (#25) * fix: require(...) is not a function (#28) * update * fix linter * fix astro * fix tests * use jiti over esno * update all eslint * dedupe * update node used for linter * fix prettier --------- Co-authored-by: Anthony Fu <[email protected]> Co-authored-by: TropicalRaisel <[email protected]> Co-authored-by: dengqing <[email protected]> Co-authored-by: Tedy <[email protected]> Co-authored-by: snowingfox <[email protected]> Co-authored-by: Rongger <[email protected]> Co-authored-by: 三咲智子 <[email protected]> Co-authored-by: Alex Liu <[email protected]> Co-authored-by: ntnyq <[email protected]> Co-authored-by: Robert Soriano <[email protected]> Co-authored-by: Ray <[email protected]> Co-authored-by: yuyin <[email protected]> Co-authored-by: lrs <[email protected]>
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: