-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
[Feature Request]: @storybook/vue3 not support defineExpose? #21684
Comments
Would be great if storybook can support
|
there is a PR #22285 addresses this, not yet merge |
Fixed with #22285 in version 8 |
While issue #22285 has enabled the documentation of exposed values in Storybook for Vue3, it seems that accessing these values directly is still not possible. In Vue3, the |
Hey @Hiroshiba, what do you mean with „can not be referenced from a Story“? Could you please add an example code snippet about what you want to achieve? :) |
Thank you for your prompt response, @larsrickert! I've put together a sample code snippet to illustrate my point. Apologies if the syntax isn't the latest, I might be a bit behind on the updates. You can see the setup here: If you run However, I believe there is still no provided method to access this |
@Hiroshiba Thanks for the reproduction :) I don't see the usage of import { ref } from "vue";
const Template = (args) => ({
components: { Counter },
setup() {
const counterRef = ref();
return { args, counterRef };
},
template: `
<div>Exposed count: {{ counterRef?.count }}</div>
<Counter ref="counterRef" v-bind="args"/>`,
}); |
Thanks for the clarification and the modified example, @larsrickert! I see your point about modifying the component code to allow external state manipulation, similar to React. Indeed, if we alter the component’s code, it becomes possible. However, my concern lies with the fact that Storybook does not yet support referencing On a related note, while Vue's |
Using template refs for data exposed with If you want to still request a new Storybook feature, please add an example code snippet with a suggestion how the feature should work / look like :) |
Is your feature request related to a problem? Please describe
@storybook/vue3 support methods but not support defineExpose?
Describe the solution you'd like
when support
Describe alternatives you've considered
No response
Are you able to assist to bring the feature to reality?
no
Additional context
No response
The text was updated successfully, but these errors were encountered: