Skip to content

Commit

Permalink
Merge pull request #18959 from ProjektGopher/fix/extractArgTypes
Browse files Browse the repository at this point in the history
Vue: Fix enum check in extractArgTypes
  • Loading branch information
shilman committed Aug 22, 2022
1 parent f00e484 commit fca777b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/vue/src/client/docs/extractArgTypes.ts
Expand Up @@ -11,7 +11,7 @@ const SECTIONS = ['props', 'events', 'slots', 'methods'];
function isEnum(propDef: PropDef, docgenInfo: DocgenInfo): false | PropDef {
// cast as any, since "values" doesn't exist in DocgenInfo type
const { type, values } = docgenInfo as any;
const matched = Array.isArray(values) && values.length && type?.name !== 'enum';
const matched = Array.isArray(values) && values.length && type?.name === 'enum';

if (!matched) {
return false;
Expand Down

1 comment on commit fca777b

@kitroling
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"@values" comment do not work now.
I have the following code:

  /**
    * @values filled,outlined,twoTone
    */
   theme: {
     type: String,
     default: 'outlined',
   },

In this line. When check isEnum, 'values.length' is 3, 'type.name' is 'string', so its should be enum. Obviously, there is a mistake here

Please sign in to comment.