pocka / storybook-addon-vue-info

Info addon for Vue components
https://storybook-addon-vue-info.netlify.com/?path=/story/examples-basic-usage--simple-example
MIT License
164 stars 28 forks source link

Hide Props section if there is none in the component #57

Closed miguelRivero closed 5 years ago

miguelRivero commented 6 years ago

Is your feature request related to a problem? Please describe. I've tried to use propTablesExclude for this with vue, but it doesn't work

Describe the solution you'd like Hide Props section if there is none in the component, so it doesnt show the props table header and no content

Describe alternatives you've considered Pass a boolean to hide Pros in settings, or do it automatically

pocka commented 6 years ago

I've tried to use propTablesExclude for this with vue, but it doesn't work

Yes, propTablesExclude is not implemented :persevere:

IMO, implementing propTablesExclude is better and straightfoward than adding custom option to hide props section.

pocka commented 6 years ago

@miguelRivero Does #60 solve the problem?

miguelRivero commented 6 years ago

@miguelRivero Does #60 solve the problem?

Not for me.

miguelRivero commented 6 years ago

I think my problem is related to the plugin. My stories using withInfo show this message: "context is undefined". If I remove the addon, it works fine. If I use it as a decorator, it also works. Here is a sample of my code. Any idea? .add('CardImage', withInfo({ propTablesExclude: [CardImage] })( withNotes(_notesCardImage)(() => ({ data () { return { cardData: _cardData } }, components: { CardImage }, template: _cardImage }))) )

pocka commented 6 years ago

@miguelRivero Is your problem "Having an error context is undefined when use storybook-addon-vue-info" ? If so, please fill an another issue. I tested propTablesExclude option and confirmed it works. I think this issue (Hide Props section if there is none in the component) is now resolved.

pocka commented 5 years ago

In v1.0.0-alpha, the addon now hides prop tables when the component does not have any props.