Skip to content

Commit

Permalink
Merge pull request #28760 from storybookjs/larsrickert/fix-missing-pr…
Browse files Browse the repository at this point in the history
…op-controls

Vue: Add missing prop controls when using `vue-component-meta` docgen plugin
  • Loading branch information
kasperpeulen authored Sep 11, 2024
2 parents 5d4791c + 01d1ef2 commit 87bf34c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions code/frameworks/vue3-vite/src/plugins/vue-component-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,5 +287,11 @@ function removeNestedSchemas(schema: PropertyMetaSchema) {
if (typeof schema !== 'object') {
return;
}
if (schema.kind === 'enum') {
// for enum types, we do not want to remove the schemas because otherwise the controls will be missing
// instead we remove the nested schemas for the enum entries to prevent out of memory errors for types like "HTMLElement | MouseEvent"
schema.schema?.forEach((enumSchema) => removeNestedSchemas(enumSchema));
return;
}
delete schema.schema;
}

0 comments on commit 87bf34c

Please sign in to comment.