Replies: 1 comment
-
I have a use case for this as well. I've noticed that older versions of Storybook (via various docs/articles online) seem to have touched on using the created hook for mocking pinia values, but this does not seem to be as functional or recommended in the current stable version. I think there are real valid use cases out there for being able to clearly supply values in the pinia store for Storybook stories for the sake of mocking scenarios, without needing to refactor the components to be strictly presentational. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
Hey there,
I am using Storybook on a Vue3 project with Pinia as a store manager.
I am using a pattern where each component gets data directly from the store without receiving props.
I really would like to use the Storybook controls to manipulate the store in order to see the changes in my component.
So, for example, I have a component like this:
And then a control
myTitle
would appear, and every time I update the value of the control, the corresponding value in the Pinia store will be updated, and so will be also my component.Am I the only one with this need? It looks weird, I think it's a quite common use case and many would benefit from it.
That's why I thought that I am the one that is doing something wrong or I just do not know how to do it in Storybook.
Any ideas?
Additional information
No response
Create a reproduction
No response
Beta Was this translation helpful? Give feedback.
All reactions