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

Vue: Add missing prop controls when using vue-component-meta docgen plugin #28760

Merged
merged 4 commits into from
Sep 11, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion code/frameworks/vue3-vite/src/plugins/vue-component-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,11 @@ async function getTsConfigReferences(tsConfigPath: string) {
* HTMLElement, MouseEvent) are used.
*/
function removeNestedSchemas(schema: PropertyMetaSchema) {
if (typeof schema !== 'object') {
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;
Expand Down