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

[Bug] - can't set Required? #364

Open
Elaniobro opened this issue Aug 6, 2020 · 5 comments
Open

[Bug] - can't set Required? #364

Elaniobro opened this issue Aug 6, 2020 · 5 comments

Comments

@Elaniobro
Copy link

Awesome plugin, really liking how it works so far.

Not sure if this a bug, known or other, but I can't seem to set the Required? table cell in the @vue-props declaration.

/**
 * @vue-prop {('cube-grid'|'three-bounce')} [name='cube-grid'] - optional='Yes' - true - name of loader to use
 * @vue-prop {Number} [size=30] - [optional='Yes'] - size of loading icons width
 * @vue-prop {String} [bgColor=#000] - required='Yes' - hexadecimal color value for loader
 * @vue-prop {String} [bgColor=#000] - [required='Yes'] - hexadecimal color value for loader
*/

Nothing seems to work, and Required? is always No

@Kocal
Copy link
Owner

Kocal commented Aug 11, 2020

Hi, and thanks for your words.

I think you need to use this to make a property required:

/**
 * @vue-prop {String} bgColor - hexadecimal color value for loader
 */

Since it uses bgColor instead of [bgColor=#000], the property is now seen as required.

See https://github.com/Kocal/jsdoc-vuejs#usage and https://jsdoc.app/tags-param.html#optional-parameters-and-default-values for more information

@Elaniobro
Copy link
Author

Thank you for your reply, how then would you set the default value, along side required?
* @vue-prop {('cube-grid'|'three-bounce')} [name='cube-grid'] - name of loader to use
Screen Shot 2020-08-11 at 3 25 55 PM

* @vue-prop {('cube-grid'|'three-bounce')} name - name of loader to use
Screen Shot 2020-08-11 at 3 24 42 PM

I can't seem to get both to work, the bug, or I am doing something very wrong. Thanks!

@Kocal
Copy link
Owner

Kocal commented Aug 12, 2020

How can a Vue props can be required if it has a default value?

@Elaniobro
Copy link
Author

@Kocal fair enough, but the documentation is then confusing since Required? says no. Would it not make more sense to then void the value e.g. -since the Default Value is present? Similar to how its show when Required? is Yes?

@Programina
Copy link

Programina commented Jun 25, 2021

I will be honest here and admit that I also find the documentation might benefit from being a little clearer on what part of that syntax designates what. I am currently doing a lot of trial and error . I got there eventually, but knowing that the default value needs to be sqashed in the square brackets with the name, whereas other bits are simply separated by spaces. The hyphens before "description" seem to be more of a stylistic best practice? I could easily remove them.

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

3 participants