You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Let's say I have ComponentA and ComponentB. ComponentA requires some things to be provided by the wrapper, and some globals to be mocked. ComponentB requires something totally different, but maybe with the same name. It's not possible to use the same wrapper for previewing both.
Describe the solution you'd like
I don't have strong opinions about how to implement this, but here are some ideas:
Specify in nuxt.config.ts which components will use which wrapper. Something like
Allow a file name pattern like ComponentA.wrapper.vue and ComponentB.wrapper.vue.
Some of these suggestions only allow a 1:1 relationship between wrapper and component. Others allow 1:N relationship between wrapper and components. Currently, we have a 1:all relationship (just one wrapper for all components in the project)
Describe alternatives you've considered
Create a folder called componentExamples or componentPreviews that contain components that are not used in production, but only as examples for preview. This can get a bit tedious.
The text was updated successfully, but these errors were encountered:
Thanks! I'll try that. I have not used Storybook before (my first time hearing about it was at ViteConf). Does it also work with <script setup lang="ts"> and/or composition API? nevermind, I read the storybook docs now, and I understand better.
But now that I have tried storybook, I don't understand why one would use PreviewJS with storybook. They seem to do similar things.
Originally posted by @fwouts in #2086 (comment)
Is your feature request related to a problem? Please describe.
Let's say I have
ComponentA
andComponentB
.ComponentA
requires some things to be provided by the wrapper, and some globals to be mocked.ComponentB
requires something totally different, but maybe with the same name. It's not possible to use the same wrapper for previewing both.Describe the solution you'd like
I don't have strong opinions about how to implement this, but here are some ideas:
nuxt.config.ts
which components will use which wrapper. Something like/// <wrapper = foo>
in the component file.ComponentA.wrapper.vue
andComponentB.wrapper.vue
.Some of these suggestions only allow a
1:1
relationship between wrapper and component. Others allow1:N
relationship between wrapper and components. Currently, we have a1:all
relationship (just one wrapper for all components in the project)Describe alternatives you've considered
componentExamples
orcomponentPreviews
that contain components that are not used in production, but only as examples for preview. This can get a bit tedious.The text was updated successfully, but these errors were encountered: