Skip to content
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

Documentation for prop in mixin override same name prop documentation in _others_ components #116

Closed
0m4r opened this issue Apr 18, 2018 · 5 comments

Comments

@0m4r
Copy link

0m4r commented Apr 18, 2018

If you have a bunch of components, and one of them includes a mixin, all the following components having a prop with the same name already defined in that mixin will have their documentation overridden with the one coming from the mixin.

So, for example, if in test.mixin.js you have

props: {
  /**
   * a prop from the mixin
   */
  test: {
    type: String,
    required: false,
   default: null
}

all the components with the same prop, parsed after this mixin is processed get as a Description a prop from the mixin instead of the local description you might have added in the specific component - that does not use or reference the mixin.

note:

a use case has been built here:
https://github.com/bwcgn/vue-styleguidist-test/tree/repro/mixin-and-documentation

The HelloWorld component includes a mixin with a prop named testProp, the local testProp documentation is overridden (but the same happens to the testProp of HelloWorld2 component but it does not include the mixin!) The BeforeComponent, instead, looks good.

screencapture-localhost-6060-2018-04-18-12_54_45

Not sure if this somehow relates to #7

@0m4r 0m4r mentioned this issue Apr 18, 2018
@rafaesc
Copy link
Member

rafaesc commented Apr 18, 2018

Hi @0m4r,

I will review it

@rafaesc
Copy link
Member

rafaesc commented Apr 20, 2018

It fixed on version 1.7.4

@rafaesc rafaesc closed this as completed Apr 20, 2018
@0m4r
Copy link
Author

0m4r commented Apr 23, 2018

hey @rafaesc I guess that based on this: https://vuejs.org/v2/guide/mixins.html

"For example, data objects undergo a shallow merge (one property deep), with the component’s data taking priority in cases of conflicts."

the way the doc works should be the other way around, so, local prop overriding the mixin prop.
It looks to me to be the opposite of what it is now.

I have updated the repro use case here: https://github.com/bwcgn/vue-styleguidist-test
Let me know if I can help!

Thanks!

@rafaesc
Copy link
Member

rafaesc commented Apr 25, 2018

@0m4r Ready for version 1.7.5

@0m4r
Copy link
Author

0m4r commented Apr 26, 2018

@rafaesc when do you plan to release it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants